3 ms·
A quadratic algorithm optimized by v8 will be still quadratic. While these optimizations can be helpful, real problem is order of growth. To optimize order of
by partycoder 10y ago
A quadratic algorithm optimized by v8 will be still quadratic.
While these optimizations can be helpful, real problem is order of growth. To optimize order of growth problems knowledge of algorithms and data structures is important.
Optimization can be assisted by instrumentation and profiling.
- seangrogg 10y ago> A quadratic algorithm optimized by v8 will be still quadratic. That's pretty obvious. An engine's optimization features are there to help execute code faster, not as a substitute for knowledge about algorithms and data structures. The implication here is that being respectful of both solid CS theory and an engine's optimized patterns allows you to benefit from both, not just one or another.
- partycoder 10y agoI had an application with a performance bottleneck once, and people kept telling me that the solution was to upgrade node. I ignored them, ran a profiler, found a bottleneck and fixed the bottleneck. Sounds obvious but not everyone is familiar with performance optimization.
- seangrogg 10y agoOut of curiosity did you also check to see if upgrading node would've also been to your benefit? It could just be a side-effect of working at a large company with smart people, but if "people" are telling me the solution is an upgrade I wouldn't be doing my due diligence to ignore them all. Not trying to invalidate the fact that you found a way to enhance performance via profiling - that's great! But the way you phrased your response seemed very condescending of "people" when there may have been truth to what they said.
- jfroma 10y agoI agree that this the last thing I would check. An application can work perfectly find with some functions not optimized. In fact, I have find unoptimized functions in node.js itself last week in the streams abstractions. Regarding performance of node.js applications I often find myself looking at my cpu profiles and memory dumps in node-inspector because the most common problems are eventloop starvation, memory leaks or long GC pauses.