-
Notifications
You must be signed in to change notification settings - Fork 0
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
Candidates for performance optimization #1
Comments
That's already happening, see L38.
IMO it's questionable how much performance we can gain by that change. We should measure the performance of both versions and pick up the fastest one.
Definitely, we should use |
Having said that, we are creating a new array for each request later on L61 ( |
for-loop is much faster than Array.prototype.forEach, see http://jsperf.com/fast-array-foreach. I already used the same technique to optimize juggler before. |
L38 doesn't help as the declaration of preHandlers at line 36 is scoped to the handler function, not the middleware factory. As a result, L38 is always evaluated to true. |
We should also look into usages that prevent V8 optimization - https://github.com/petkaantonov/bluebird/wiki/Optimization-killers. |
Good catch! |
Another PR - expressjs/cors#35 |
https://github.com/strongloop/loopback/blob/master/server/middleware/rest.js#L27
https://github.com/strongloop/strong-remoting/blob/master/lib/http-context.js#L68
The text was updated successfully, but these errors were encountered: