SlideShare a Scribd company logo
1 of 20
Download to read offline
Startup Snapshot in
Node.js
Joyee Cheung, 14 May 2023
About me
● Compilers @ Igalia
● Node.js TSC member & V8 committer
● Been working on startup performance → startup snapshot strategic initiative
Challenge of Node.js core startup
● Node.js is growing: increasing number of
○ Globals (in particular Web APIs)
○ Built-in modules and new APIs in existing modules
○ …and generally “things to do to make new things work”: set up handlers, define accessors…
● In v18-v20:
○ Fetch
○ WebCrypto
○ File API, Blob
○ Web streams: globalThis.ReadableStream, globalThis.CompressionStream…
○ util.parseArgs, util.MIMEType...
Challenge of Node.js core startup
● The Node.js core is roughly half in JavaScript, half in C++ (and some others)
● Pros
○ Lower the contribution barrier
○ Reduce some C++ → JavaScript callback costs
● Cons
○ Need to parse and compile JavaScript
○ Overall initialization speed is affected - JS code that only gets run once don’t get optimized
○ Need to defend against prototype pollution and monkey patching: copying JS built-ins at
startup to avoid blowups caused by e.g. delete String.prototype.startsWith
Trying to keep the startup under control
1. Lazy loading: do not load non-essential features until it’s actually used
○ e.g. crypto, performance timing, messaging
2. Code cache: when loading additional features (built-in modules)
○ Bytecode and metadata etc.
○ Compiled and embedded into the executable at build time.
○ Skips compilation when validation passes.
3. V8 startup snapshot: pre-initialize features that are almost always loaded /
essential initializations
○ URL, fs, etc…used by other internals
○ Buffer, setTimeout, etc.: widely used
○ Skips execution of the initialization code
Startup snapshots within Node.js core
Internal JS in source
Embed into
executable
Internal JS
node executable
BUILD TIME RUN TIME
Raw bootstrap code
Compiled bootstrap code
Initialized Node.js core
Parse, compile
Execute
Initialized user app
Process user input,
system states
Internal JS
node executable
BUILD TIME RUN TIME
Raw bootstrap code
Compiled bootstrap code
Initialized Node.js core
Parse, compile
Execute
Initialized user app
Process user input,
system states
Startup snapshots within Node.js core
Internal JS
Compiled code
Pre-compile
Embed into
executable
Code cache
Internal JS
node executable
BUILD TIME RUN TIME
Raw bootstrap code
Compiled bootstrap code
Initialized Node.js core
Parse, compile
Execute
Initialized user app
Process user input,
system states
Code cache
Startup snapshots within Node.js core
Internal JS + Native
Embed into
executable
Snapshot
Initialized Node.js heap
Parse, compile,
execute
Snapshot
Serialize
What are V8 startup snapshots?
● V8 heap states serialized into a binary blob
● Isolate snapshot: shared by main instance and workers
○ Primitives: strings, symbols, etc.
○ Native bindings
● Context snapshot: main context, vm contexts, worker context (minimal)
○ Execution context
○ Globals
○ Objects
○ Functions
Startup snapshots within Node.js core
● The default startup (with snapshot) is generally 2x faster than startup with --
no-node-snapshot: ~40ms -> ~20ms
● A sustainable path for growing core & keeping startup under control
User-land startup snapshots
Creating snapshots from user application code, useful if
● Startup performance matters e.g. in CLI tools
● A lot of code needs to be compiled/run during startup
● A lot of system-independent data needs to be loaded during startup
User-land startup snapshots
● Currently requires the snapshot script to be a one-file bundle
○ User-land module support is WIP
● Run-to-completion: until async operations are finished, promises are resolved
User JS script
Initialized user heap
Parse, compile, execute
Snapshot
Serialize
Initialized user heap
User app
Process additional
input, system states
node
executable
Deserialize
User-land startup snapshots
Build-time generation, embedded binary: from v17.9.0
● Building Node.js from source and embedding the snapshot into the binary
$ echo 'globalThis.data = "hello"' > snapshot.js
$ cd /path/to/node
$ ./configure --node-snapshot-main=snapshot.js && make node
$ out/Release/node # globalThis.data contains "hello"
User-land startup snapshots
Run-time generation, separate binary: from v18.8.0
● Use the default Node.js binary to write snapshot to a separate blob for
loading later
$ node --snapshot-blob snapshot.blob --build-snapshot snapshot.js
$ node --snapshot-blob snapshot.blob # deserialize snapshot
User-land startup snapshots
Runtime generation, embedded binary: in v20.?
● Layer on top of single-executable application (work in progress)
● Use the default Node.js binary to generate a blob which includes the snapshot
(and more), and inject it into one single executable
● No need to compile Node.js from source
● A single-line utility command to come
$ echo '{"snapshot_main":"sea.js","output":"sea.blob"}' > sea.json
$ node --experimental-sea-config sea.json
$ cp node sea
$ npx postject sea NODE_SEA_BLOB sea.blob --sentinel-fuse 
$NODE_SEA_FUSE
$ ./sea # contains snapshot
JS API: Synchronizing run-time states
● Node.js refreshes process.env and process.argv etc. when the
snapshot is deserialized
● States computed from system states can be synchronized during
deserialization.
let debug_level = 0;
function computeDebugLevel() {
switch (process.env.DEBUG_LEVEL) {
case 'none': debug_level = 0; break;
case 'debug': debug_level = 1; break;
}
}
JS API: Synchronizing run-time states
const {
addSerializeCallback, addDeserializeCallback, isBuildingSnapshot
} = require(‘v8’).startupSnapshot;
// Usual startup
computeDebugLevel();
// Snapshot synchronization
if (isBuildingSnapshot()) {
addSerializeCallback(() => { debug_level = 0; /* reset */ })
addDeserializeCallback(computeDebugLevel); /* re-compute */
}
// Or, defer the computation until deserialization if building snapshot
if (!isBuildingSnapshot()) { computeDebugLevel(); }
else { addDeserializeCallback(computeDebugLevel); }
JS API: configure main function
// In the snapshot:
const greetings = { en_US: 'hello', zh_CN: '你好', es_ES: 'hola' };
2. Configure the main function in the same snapshot script
$ echo "console.log(greetings[process.env.LANGUAGE])" > hello.js
$ LANGUAGE=en_US node --snapshot-blob snapshot.blob hello.js # logs "hello"
1. Pass a separate main script that does the logging
$ LANGUAGE=en_US node --snapshot-blob snapshot.blob # logs "hello"
require('v8').startupSnapshot.setDeserializeMainFunction(() => {
console.log(greetings[process.env.LANGUAGE]);
});
Summary
● Startup snapshot has been integrated into Node.js core to speed up core
startup
● Experimental user-land snapshot support is now available, with JS APIs in
v8.startupSnapshot
● Support for single executable applications and more features is WIP
Thanks
● @addaleax, @cjihrig, @jasnel, @legendecas, @RaisinTen, et al.
● Bloomberg & Igalia

More Related Content

What's hot

C/C++プログラマのための開発ツール
C/C++プログラマのための開発ツールC/C++プログラマのための開発ツール
C/C++プログラマのための開発ツールMITSUNARI Shigeo
 
フリーでやろうぜ!セキュリティチェック!
フリーでやろうぜ!セキュリティチェック!フリーでやろうぜ!セキュリティチェック!
フリーでやろうぜ!セキュリティチェック!zaki4649
 
AWS社員による怒涛のLTチャレンジ! なかなか飛行機に乗れてないので、Ruby on Jetsで飛んでみよう!
AWS社員による怒涛のLTチャレンジ! なかなか飛行機に乗れてないので、Ruby on Jetsで飛んでみよう!AWS社員による怒涛のLTチャレンジ! なかなか飛行機に乗れてないので、Ruby on Jetsで飛んでみよう!
AWS社員による怒涛のLTチャレンジ! なかなか飛行機に乗れてないので、Ruby on Jetsで飛んでみよう!Amazon Web Services Japan
 
Rookの基礎・バージョンアップ
Rookの基礎・バージョンアップRookの基礎・バージョンアップ
Rookの基礎・バージョンアップTakashi Sogabe
 
MySQLレプリケーションあれやこれや
MySQLレプリケーションあれやこれやMySQLレプリケーションあれやこれや
MySQLレプリケーションあれやこれやyoku0825
 
Spectre/Meltdownとその派生
Spectre/Meltdownとその派生Spectre/Meltdownとその派生
Spectre/Meltdownとその派生MITSUNARI Shigeo
 
AWSスポットインスタンスの真髄
AWSスポットインスタンスの真髄AWSスポットインスタンスの真髄
AWSスポットインスタンスの真髄外道 父
 
スマートフォン向けサービスにおけるサーバサイド設計入門
スマートフォン向けサービスにおけるサーバサイド設計入門スマートフォン向けサービスにおけるサーバサイド設計入門
スマートフォン向けサービスにおけるサーバサイド設計入門Hisashi HATAKEYAMA
 
HA環境構築のベスト・プラクティス
HA環境構築のベスト・プラクティスHA環境構築のベスト・プラクティス
HA環境構築のベスト・プラクティスEnterpriseDB
 
カスタムメモリマネージャと高速なメモリアロケータについて
カスタムメモリマネージャと高速なメモリアロケータについてカスタムメモリマネージャと高速なメモリアロケータについて
カスタムメモリマネージャと高速なメモリアロケータについてalwei
 
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭する
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭するCEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭する
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭するYoshifumi Kawai
 
Go言語のスライスを理解しよう
Go言語のスライスを理解しようGo言語のスライスを理解しよう
Go言語のスライスを理解しようYasutaka Kawamoto
 
C16 45分でわかるPostgreSQLの仕組み by 山田努
C16 45分でわかるPostgreSQLの仕組み by 山田努C16 45分でわかるPostgreSQLの仕組み by 山田努
C16 45分でわかるPostgreSQLの仕組み by 山田努Insight Technology, Inc.
 
Javaはどのように動くのか~スライドでわかるJVMの仕組み
Javaはどのように動くのか~スライドでわかるJVMの仕組みJavaはどのように動くのか~スライドでわかるJVMの仕組み
Javaはどのように動くのか~スライドでわかるJVMの仕組みChihiro Ito
 
Dockerを使ったローカルでの開発から本番環境へのデプロイまで
Dockerを使ったローカルでの開発から本番環境へのデプロイまでDockerを使ったローカルでの開発から本番環境へのデプロイまで
Dockerを使ったローカルでの開発から本番環境へのデプロイまでRyo Nakamaru
 
10分でわかるOpenAPI V3
10分でわかるOpenAPI V310分でわかるOpenAPI V3
10分でわかるOpenAPI V3Kazuchika Sekiya
 
Dockerのディスクについて ~ファイルシステム・マウント方法など~
Dockerのディスクについて ~ファイルシステム・マウント方法など~Dockerのディスクについて ~ファイルシステム・マウント方法など~
Dockerのディスクについて ~ファイルシステム・マウント方法など~HommasSlide
 
Keycloakの実際・翻訳プロジェクト紹介
Keycloakの実際・翻訳プロジェクト紹介Keycloakの実際・翻訳プロジェクト紹介
Keycloakの実際・翻訳プロジェクト紹介Hiroyuki Wada
 
db tech showcase 2019 SQL Database Hyperscale 徹底分析 - 最新アーキテクチャの特徴を理解する
db tech showcase 2019 SQL Database Hyperscale 徹底分析 - 最新アーキテクチャの特徴を理解するdb tech showcase 2019 SQL Database Hyperscale 徹底分析 - 最新アーキテクチャの特徴を理解する
db tech showcase 2019 SQL Database Hyperscale 徹底分析 - 最新アーキテクチャの特徴を理解するMasayuki Ozawa
 
C++でできる!OS自作入門
C++でできる!OS自作入門C++でできる!OS自作入門
C++でできる!OS自作入門uchan_nos
 

What's hot (20)

C/C++プログラマのための開発ツール
C/C++プログラマのための開発ツールC/C++プログラマのための開発ツール
C/C++プログラマのための開発ツール
 
フリーでやろうぜ!セキュリティチェック!
フリーでやろうぜ!セキュリティチェック!フリーでやろうぜ!セキュリティチェック!
フリーでやろうぜ!セキュリティチェック!
 
AWS社員による怒涛のLTチャレンジ! なかなか飛行機に乗れてないので、Ruby on Jetsで飛んでみよう!
AWS社員による怒涛のLTチャレンジ! なかなか飛行機に乗れてないので、Ruby on Jetsで飛んでみよう!AWS社員による怒涛のLTチャレンジ! なかなか飛行機に乗れてないので、Ruby on Jetsで飛んでみよう!
AWS社員による怒涛のLTチャレンジ! なかなか飛行機に乗れてないので、Ruby on Jetsで飛んでみよう!
 
Rookの基礎・バージョンアップ
Rookの基礎・バージョンアップRookの基礎・バージョンアップ
Rookの基礎・バージョンアップ
 
MySQLレプリケーションあれやこれや
MySQLレプリケーションあれやこれやMySQLレプリケーションあれやこれや
MySQLレプリケーションあれやこれや
 
Spectre/Meltdownとその派生
Spectre/Meltdownとその派生Spectre/Meltdownとその派生
Spectre/Meltdownとその派生
 
AWSスポットインスタンスの真髄
AWSスポットインスタンスの真髄AWSスポットインスタンスの真髄
AWSスポットインスタンスの真髄
 
スマートフォン向けサービスにおけるサーバサイド設計入門
スマートフォン向けサービスにおけるサーバサイド設計入門スマートフォン向けサービスにおけるサーバサイド設計入門
スマートフォン向けサービスにおけるサーバサイド設計入門
 
HA環境構築のベスト・プラクティス
HA環境構築のベスト・プラクティスHA環境構築のベスト・プラクティス
HA環境構築のベスト・プラクティス
 
カスタムメモリマネージャと高速なメモリアロケータについて
カスタムメモリマネージャと高速なメモリアロケータについてカスタムメモリマネージャと高速なメモリアロケータについて
カスタムメモリマネージャと高速なメモリアロケータについて
 
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭する
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭するCEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭する
CEDEC 2018 最速のC#の書き方 - C#大統一理論へ向けて性能的課題を払拭する
 
Go言語のスライスを理解しよう
Go言語のスライスを理解しようGo言語のスライスを理解しよう
Go言語のスライスを理解しよう
 
C16 45分でわかるPostgreSQLの仕組み by 山田努
C16 45分でわかるPostgreSQLの仕組み by 山田努C16 45分でわかるPostgreSQLの仕組み by 山田努
C16 45分でわかるPostgreSQLの仕組み by 山田努
 
Javaはどのように動くのか~スライドでわかるJVMの仕組み
Javaはどのように動くのか~スライドでわかるJVMの仕組みJavaはどのように動くのか~スライドでわかるJVMの仕組み
Javaはどのように動くのか~スライドでわかるJVMの仕組み
 
Dockerを使ったローカルでの開発から本番環境へのデプロイまで
Dockerを使ったローカルでの開発から本番環境へのデプロイまでDockerを使ったローカルでの開発から本番環境へのデプロイまで
Dockerを使ったローカルでの開発から本番環境へのデプロイまで
 
10分でわかるOpenAPI V3
10分でわかるOpenAPI V310分でわかるOpenAPI V3
10分でわかるOpenAPI V3
 
Dockerのディスクについて ~ファイルシステム・マウント方法など~
Dockerのディスクについて ~ファイルシステム・マウント方法など~Dockerのディスクについて ~ファイルシステム・マウント方法など~
Dockerのディスクについて ~ファイルシステム・マウント方法など~
 
Keycloakの実際・翻訳プロジェクト紹介
Keycloakの実際・翻訳プロジェクト紹介Keycloakの実際・翻訳プロジェクト紹介
Keycloakの実際・翻訳プロジェクト紹介
 
db tech showcase 2019 SQL Database Hyperscale 徹底分析 - 最新アーキテクチャの特徴を理解する
db tech showcase 2019 SQL Database Hyperscale 徹底分析 - 最新アーキテクチャの特徴を理解するdb tech showcase 2019 SQL Database Hyperscale 徹底分析 - 最新アーキテクチャの特徴を理解する
db tech showcase 2019 SQL Database Hyperscale 徹底分析 - 最新アーキテクチャの特徴を理解する
 
C++でできる!OS自作入門
C++でできる!OS自作入門C++でできる!OS自作入門
C++でできる!OS自作入門
 

Similar to Startup Snapshot in Node.js

OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopleffen
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsVikash Singh
 
An overview of node.js
An overview of node.jsAn overview of node.js
An overview of node.jsvaluebound
 
Nodejs web service for starters
Nodejs web service for startersNodejs web service for starters
Nodejs web service for startersBruce Li
 
Modern Development Tools
Modern Development ToolsModern Development Tools
Modern Development ToolsYe Maw
 
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteorSapna Upreti
 
Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Slobodan Lohja
 
Day in a life of a node.js developer
Day in a life of a node.js developerDay in a life of a node.js developer
Day in a life of a node.js developerEdureka!
 
Day In A Life Of A Node.js Developer
Day In A Life Of A Node.js DeveloperDay In A Life Of A Node.js Developer
Day In A Life Of A Node.js DeveloperEdureka!
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient waySylvain Rayé
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsasync_io
 
Making your app soar without a container manifest
Making your app soar without a container manifestMaking your app soar without a container manifest
Making your app soar without a container manifestLibbySchulze
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers WorkshopJody Garnett
 
AngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue SolutionsAngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue SolutionsRapidValue
 
Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Ganesh Kondal
 
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe Sencha
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationDavid Amend
 

Similar to Startup Snapshot in Node.js (20)

Nodejs
NodejsNodejs
Nodejs
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshop
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Treinamento frontend
Treinamento frontendTreinamento frontend
Treinamento frontend
 
An overview of node.js
An overview of node.jsAn overview of node.js
An overview of node.js
 
Nodejs web service for starters
Nodejs web service for startersNodejs web service for starters
Nodejs web service for starters
 
Modern Development Tools
Modern Development ToolsModern Development Tools
Modern Development Tools
 
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteor
 
Node js
Node jsNode js
Node js
 
Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021
 
Day in a life of a node.js developer
Day in a life of a node.js developerDay in a life of a node.js developer
Day in a life of a node.js developer
 
Day In A Life Of A Node.js Developer
Day In A Life Of A Node.js DeveloperDay In A Life Of A Node.js Developer
Day In A Life Of A Node.js Developer
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
 
Making your app soar without a container manifest
Making your app soar without a container manifestMaking your app soar without a container manifest
Making your app soar without a container manifest
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
 
AngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue SolutionsAngularJS Project Setup step-by- step guide - RapidValue Solutions
AngularJS Project Setup step-by- step guide - RapidValue Solutions
 
Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6Tech io nodejs_20130531_v0.6
Tech io nodejs_20130531_v0.6
 
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe
SenchaCon 2016: Develop, Test & Deploy with Docker - Jonas Schwabe
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous Integration
 

More from Igalia

Running JS via WASM faster with JIT
Running JS via WASM      faster with JITRunning JS via WASM      faster with JIT
Running JS via WASM faster with JITIgalia
 
To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!Igalia
 
Implementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerImplementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerIgalia
 
8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in MesaIgalia
 
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIntroducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIgalia
 
2023 in Chimera Linux
2023 in Chimera                    Linux2023 in Chimera                    Linux
2023 in Chimera LinuxIgalia
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVMIgalia
 
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsturnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsIgalia
 
Graphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesGraphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesIgalia
 
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSDelegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSIgalia
 
MessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webMessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webIgalia
 
Replacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersReplacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersIgalia
 
I'm not an AMD expert, but...
I'm not an AMD expert, but...I'm not an AMD expert, but...
I'm not an AMD expert, but...Igalia
 
Status of Vulkan on Raspberry
Status of Vulkan on RaspberryStatus of Vulkan on Raspberry
Status of Vulkan on RaspberryIgalia
 
Enable hardware acceleration for GL applications without glamor on Xorg modes...
Enable hardware acceleration for GL applications without glamor on Xorg modes...Enable hardware acceleration for GL applications without glamor on Xorg modes...
Enable hardware acceleration for GL applications without glamor on Xorg modes...Igalia
 
Async page flip in DRM atomic API
Async page flip in DRM  atomic APIAsync page flip in DRM  atomic API
Async page flip in DRM atomic APIIgalia
 
From the proposal to ECMAScript – Step by Step
From the proposal to ECMAScript – Step by StepFrom the proposal to ECMAScript – Step by Step
From the proposal to ECMAScript – Step by StepIgalia
 
Migrating Babel from CommonJS to ESM
Migrating Babel     from CommonJS to ESMMigrating Babel     from CommonJS to ESM
Migrating Babel from CommonJS to ESMIgalia
 
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...Igalia
 
Freedreno on Android – XDC 2023
Freedreno on Android          – XDC 2023Freedreno on Android          – XDC 2023
Freedreno on Android – XDC 2023Igalia
 

More from Igalia (20)

Running JS via WASM faster with JIT
Running JS via WASM      faster with JITRunning JS via WASM      faster with JIT
Running JS via WASM faster with JIT
 
To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!To crash or not to crash: if you do, at least recover fast!
To crash or not to crash: if you do, at least recover fast!
 
Implementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamerImplementing a Vulkan Video Encoder From Mesa to GStreamer
Implementing a Vulkan Video Encoder From Mesa to GStreamer
 
8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa8 Years of Open Drivers, including the State of Vulkan in Mesa
8 Years of Open Drivers, including the State of Vulkan in Mesa
 
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por IgaliaIntroducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
Introducción a Mesa. Caso específico dos dispositivos Raspberry Pi por Igalia
 
2023 in Chimera Linux
2023 in Chimera                    Linux2023 in Chimera                    Linux
2023 in Chimera Linux
 
Building a Linux distro with LLVM
Building a Linux distro        with LLVMBuilding a Linux distro        with LLVM
Building a Linux distro with LLVM
 
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUsturnip: Update on Open Source Vulkan Driver for Adreno GPUs
turnip: Update on Open Source Vulkan Driver for Adreno GPUs
 
Graphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devicesGraphics stack updates for Raspberry Pi devices
Graphics stack updates for Raspberry Pi devices
 
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOSDelegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
Delegated Compositing - Utilizing Wayland Protocols for Chromium on ChromeOS
 
MessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the webMessageFormat: The future of i18n on the web
MessageFormat: The future of i18n on the web
 
Replacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shadersReplacing the geometry pipeline with mesh shaders
Replacing the geometry pipeline with mesh shaders
 
I'm not an AMD expert, but...
I'm not an AMD expert, but...I'm not an AMD expert, but...
I'm not an AMD expert, but...
 
Status of Vulkan on Raspberry
Status of Vulkan on RaspberryStatus of Vulkan on Raspberry
Status of Vulkan on Raspberry
 
Enable hardware acceleration for GL applications without glamor on Xorg modes...
Enable hardware acceleration for GL applications without glamor on Xorg modes...Enable hardware acceleration for GL applications without glamor on Xorg modes...
Enable hardware acceleration for GL applications without glamor on Xorg modes...
 
Async page flip in DRM atomic API
Async page flip in DRM  atomic APIAsync page flip in DRM  atomic API
Async page flip in DRM atomic API
 
From the proposal to ECMAScript – Step by Step
From the proposal to ECMAScript – Step by StepFrom the proposal to ECMAScript – Step by Step
From the proposal to ECMAScript – Step by Step
 
Migrating Babel from CommonJS to ESM
Migrating Babel     from CommonJS to ESMMigrating Babel     from CommonJS to ESM
Migrating Babel from CommonJS to ESM
 
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...
The rainbow treasure map: Advanced color management on Linux with AMD/Steam D...
 
Freedreno on Android – XDC 2023
Freedreno on Android          – XDC 2023Freedreno on Android          – XDC 2023
Freedreno on Android – XDC 2023
 

Recently uploaded

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 

Recently uploaded (20)

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 

Startup Snapshot in Node.js

  • 1. Startup Snapshot in Node.js Joyee Cheung, 14 May 2023
  • 2. About me ● Compilers @ Igalia ● Node.js TSC member & V8 committer ● Been working on startup performance → startup snapshot strategic initiative
  • 3. Challenge of Node.js core startup ● Node.js is growing: increasing number of ○ Globals (in particular Web APIs) ○ Built-in modules and new APIs in existing modules ○ …and generally “things to do to make new things work”: set up handlers, define accessors… ● In v18-v20: ○ Fetch ○ WebCrypto ○ File API, Blob ○ Web streams: globalThis.ReadableStream, globalThis.CompressionStream… ○ util.parseArgs, util.MIMEType...
  • 4. Challenge of Node.js core startup ● The Node.js core is roughly half in JavaScript, half in C++ (and some others) ● Pros ○ Lower the contribution barrier ○ Reduce some C++ → JavaScript callback costs ● Cons ○ Need to parse and compile JavaScript ○ Overall initialization speed is affected - JS code that only gets run once don’t get optimized ○ Need to defend against prototype pollution and monkey patching: copying JS built-ins at startup to avoid blowups caused by e.g. delete String.prototype.startsWith
  • 5. Trying to keep the startup under control 1. Lazy loading: do not load non-essential features until it’s actually used ○ e.g. crypto, performance timing, messaging 2. Code cache: when loading additional features (built-in modules) ○ Bytecode and metadata etc. ○ Compiled and embedded into the executable at build time. ○ Skips compilation when validation passes. 3. V8 startup snapshot: pre-initialize features that are almost always loaded / essential initializations ○ URL, fs, etc…used by other internals ○ Buffer, setTimeout, etc.: widely used ○ Skips execution of the initialization code
  • 6. Startup snapshots within Node.js core Internal JS in source Embed into executable Internal JS node executable BUILD TIME RUN TIME Raw bootstrap code Compiled bootstrap code Initialized Node.js core Parse, compile Execute Initialized user app Process user input, system states
  • 7. Internal JS node executable BUILD TIME RUN TIME Raw bootstrap code Compiled bootstrap code Initialized Node.js core Parse, compile Execute Initialized user app Process user input, system states Startup snapshots within Node.js core Internal JS Compiled code Pre-compile Embed into executable Code cache
  • 8. Internal JS node executable BUILD TIME RUN TIME Raw bootstrap code Compiled bootstrap code Initialized Node.js core Parse, compile Execute Initialized user app Process user input, system states Code cache Startup snapshots within Node.js core Internal JS + Native Embed into executable Snapshot Initialized Node.js heap Parse, compile, execute Snapshot Serialize
  • 9. What are V8 startup snapshots? ● V8 heap states serialized into a binary blob ● Isolate snapshot: shared by main instance and workers ○ Primitives: strings, symbols, etc. ○ Native bindings ● Context snapshot: main context, vm contexts, worker context (minimal) ○ Execution context ○ Globals ○ Objects ○ Functions
  • 10. Startup snapshots within Node.js core ● The default startup (with snapshot) is generally 2x faster than startup with -- no-node-snapshot: ~40ms -> ~20ms ● A sustainable path for growing core & keeping startup under control
  • 11. User-land startup snapshots Creating snapshots from user application code, useful if ● Startup performance matters e.g. in CLI tools ● A lot of code needs to be compiled/run during startup ● A lot of system-independent data needs to be loaded during startup
  • 12. User-land startup snapshots ● Currently requires the snapshot script to be a one-file bundle ○ User-land module support is WIP ● Run-to-completion: until async operations are finished, promises are resolved User JS script Initialized user heap Parse, compile, execute Snapshot Serialize Initialized user heap User app Process additional input, system states node executable Deserialize
  • 13. User-land startup snapshots Build-time generation, embedded binary: from v17.9.0 ● Building Node.js from source and embedding the snapshot into the binary $ echo 'globalThis.data = "hello"' > snapshot.js $ cd /path/to/node $ ./configure --node-snapshot-main=snapshot.js && make node $ out/Release/node # globalThis.data contains "hello"
  • 14. User-land startup snapshots Run-time generation, separate binary: from v18.8.0 ● Use the default Node.js binary to write snapshot to a separate blob for loading later $ node --snapshot-blob snapshot.blob --build-snapshot snapshot.js $ node --snapshot-blob snapshot.blob # deserialize snapshot
  • 15. User-land startup snapshots Runtime generation, embedded binary: in v20.? ● Layer on top of single-executable application (work in progress) ● Use the default Node.js binary to generate a blob which includes the snapshot (and more), and inject it into one single executable ● No need to compile Node.js from source ● A single-line utility command to come $ echo '{"snapshot_main":"sea.js","output":"sea.blob"}' > sea.json $ node --experimental-sea-config sea.json $ cp node sea $ npx postject sea NODE_SEA_BLOB sea.blob --sentinel-fuse $NODE_SEA_FUSE $ ./sea # contains snapshot
  • 16. JS API: Synchronizing run-time states ● Node.js refreshes process.env and process.argv etc. when the snapshot is deserialized ● States computed from system states can be synchronized during deserialization. let debug_level = 0; function computeDebugLevel() { switch (process.env.DEBUG_LEVEL) { case 'none': debug_level = 0; break; case 'debug': debug_level = 1; break; } }
  • 17. JS API: Synchronizing run-time states const { addSerializeCallback, addDeserializeCallback, isBuildingSnapshot } = require(‘v8’).startupSnapshot; // Usual startup computeDebugLevel(); // Snapshot synchronization if (isBuildingSnapshot()) { addSerializeCallback(() => { debug_level = 0; /* reset */ }) addDeserializeCallback(computeDebugLevel); /* re-compute */ } // Or, defer the computation until deserialization if building snapshot if (!isBuildingSnapshot()) { computeDebugLevel(); } else { addDeserializeCallback(computeDebugLevel); }
  • 18. JS API: configure main function // In the snapshot: const greetings = { en_US: 'hello', zh_CN: '你好', es_ES: 'hola' }; 2. Configure the main function in the same snapshot script $ echo "console.log(greetings[process.env.LANGUAGE])" > hello.js $ LANGUAGE=en_US node --snapshot-blob snapshot.blob hello.js # logs "hello" 1. Pass a separate main script that does the logging $ LANGUAGE=en_US node --snapshot-blob snapshot.blob # logs "hello" require('v8').startupSnapshot.setDeserializeMainFunction(() => { console.log(greetings[process.env.LANGUAGE]); });
  • 19. Summary ● Startup snapshot has been integrated into Node.js core to speed up core startup ● Experimental user-land snapshot support is now available, with JS APIs in v8.startupSnapshot ● Support for single executable applications and more features is WIP
  • 20. Thanks ● @addaleax, @cjihrig, @jasnel, @legendecas, @RaisinTen, et al. ● Bloomberg & Igalia