3 ms·
Here's a really interesting video about speed performance of the v8 engine: https://www.youtube.com/watch?v=aC_QLLilwso https://www.youtube.com/watch?v=aC_QLLi
by seph-reed 6y ago
Here's a really interesting video about speed performance of the v8 engine:
https://www.youtube.com/watch?v=aC_QLLilwso https://www.youtube.com/watch?v=aC_QLLilwso
The basic points: They watch functions for "hotness" (how often they are ran). Then, any function that is super hot, they'll see if it's being ran consistently (ie always receives two numbers as its arguments). Then they'll make a streamlined interpretation of the js code which only checks the arguments and then skips pretty much all the other checks. By doing this, it makes JS significantly faster.
If you're trying to compare and contrast v8 to quickjs, this is the first thing that comes to mind for me as to what they may be doing differently.
- pvg 6y agoA more useful starting point for comparison might be the projects' respective stated goals. This is the first one listed for QuickJS: Small and easily embeddable: just a few C files, no external dependency Whereas v8's project description opens with: V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome [...] The stuff in the video is definitely super interesting but much of it is about how design goals in v8 are met.