-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory optimization #34
Comments
As far as i remember, perf problem also can happen on thousands of |
@puzrin true, it's a great tip |
For setTimeout it's possible to use the same function if you pass params: .setTimeout(fn, delay, param1, param2, ...) In browser that will require patch for IE <= 9 https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout |
I'm not convinced it'll bring anything noticeable in terms of performance. I'm sure it's more important to produce less |
https://github.com/nodejs/node/blob/master/lib/timers.js#L283 there are unofficial enroll/unenroll functions. Can be used instead of setTimeout/clearTimeout. But i'm not sure this hack is really needed. |
Currently for each memoized function there are few functions created, that affects memory badly when our configration deals with thousands of memoized instances. It'll be much more optimal to rely on prototype inheritance model in that case
The text was updated successfully, but these errors were encountered: