Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

From my cursory reading of v8 blogs, most of its optimizations revolve around detecting patterns in JS objects and replacing them with C++ classes.


Exactly. Detecting patterns that are typical for human coders and replacing them with stuff that uses the machine efficiently is what most compilers do, even for low-level languages like C. You write a typical `for` loop, the compiler recognizes it and unrolls it, and / or replaces it with a SIMD-based version with many iterations run per clock.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: