Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snapshots: move some of the bootstrap options from runtime to snapshot time #21133

Closed
bartlomieju opened this issue Nov 10, 2023 · 0 comments · Fixed by #21213
Closed

Snapshots: move some of the bootstrap options from runtime to snapshot time #21133

bartlomieju opened this issue Nov 10, 2023 · 0 comments · Fixed by #21213
Assignees
Labels
perf performance related refactor

Comments

@bartlomieju
Copy link
Member

We have following data that needs to be sent over to the runtime during bootstrapping:

struct BootstrapV8<'a>(
// args
&'a Vec<String>,
// cpu_count
i32,
// log_level
i32,
// runtime_version
&'a str,
// locale
&'a str,
// location
Option<&'a str>,
// no_color
bool,
// is_tty
bool,
// ts_version
&'a str,
// unstable
bool,
// granular unstable flags
&'a [i32],
// process_id
i32,
// env!("TARGET")
&'a str,
// v8_version
&'a str,
// user_agent
&'a str,
// inspect
bool,
// enable_testing_features
bool,
// has_node_modules_dir
bool,
// maybe_binary_npm_command_name
Option<&'a str>,
);

Some of this data is fixed for a particular build of Deno, namely:

  • runtime_version
  • ts_version
  • env!("TARGET")
  • v8_version
  • user_agent

All of these are strings which are the most expensive stuff to serialize on bootstrap. Moving them to be defined only once during snapshot should help us (although minimally) to improve the startup time.

@bartlomieju bartlomieju added perf performance related refactor labels Nov 10, 2023
littledivy added a commit that referenced this issue Nov 13, 2023
Move most runtime options to be lazily loaded. Constant options will be
covered in a different PR.

Towards #21133
kt3k pushed a commit that referenced this issue Nov 17, 2023
Move most runtime options to be lazily loaded. Constant options will be
covered in a different PR.

Towards #21133
kt3k pushed a commit that referenced this issue Nov 17, 2023
zifeo pushed a commit to metatypedev/deno that referenced this issue Nov 22, 2023
Move most runtime options to be lazily loaded. Constant options will be
covered in a different PR.

Towards denoland#21133
zifeo pushed a commit to metatypedev/deno that referenced this issue Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf performance related refactor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants