Closed ionutale closed 3 years ago
Sorry this update slipped my notice. Will review and release new version
It's not a memory leak per se but it is uneeded memory thrashing and extra work for the garbage collector.
better later than never. This has been published as 0.6.4
😁💪👍
Il giorno lun 23 nov 2020 alle 23:57 John Dean notifications@github.com ha scritto:
better later than never. This has been published as 0.6.4
— You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/CaptEmulation/clash-of-clans-api/pull/18#issuecomment-732474476, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATRTF453QL3XSUDTN33FMTSRLSG7ANCNFSM4LQDXOIA .
i make a huge amount of request each day, and slice was causing issues. after some research and app profiling, it lead me to clash-of-clans-api module. more specific, the
slice()
methodhere are some links to backup my change
and this answer is confirming that slice could create memory leaks https://stackoverflow.com/a/36851196
this is your code: https://stackoverflow.com/a/1026087 this is a guy that did some benchmark: https://stackoverflow.com/a/33704783 in this answer, there is a comment that is saying: "Note as well, that replacing
.slice(1)
with.substr(1)
would enhance performance even further. "also here look at the comments https://stackoverflow.com/a/49366757
this answer suggest substring :https://stackoverflow.com/a/33980745