Why does v8 saves the source code of native javascript in generated binaries?

前端 未结 2 2037
再見小時候
再見小時候 2021-02-06 12:50

I\'ve been studying the v8 source, particularly at how the \'mksnapshot\' tool includes a compiled image of the native javascript files(runtime.js, json.js...) in the v8 binarie

2条回答
  •  我在风中等你
    2021-02-06 13:17

    Probably because caching the binary is what makes v8 so incredibly fast: It was built to be very fast. So they have taken extreme steps to make it fast. Pre-generated binaries of native code take away the thinking from the client, making it run just that much faster. There are optimizations like this all over v8. :)

提交回复
热议问题