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

perf: static bootstrap options in snapshot #21213

Merged
merged 2 commits into from Nov 15, 2023

Conversation

littledivy
Copy link
Member

Closes #21133

@littledivy littledivy enabled auto-merge (squash) November 15, 2023 10:52
Comment on lines +359 to +365
fn deno_version() -> String {
if env::var("DENO_CANARY").is_ok() {
format!("{}+{}", env!("CARGO_PKG_VERSION"), git_commit_hash())
} else {
env!("CARGO_PKG_VERSION").to_string()
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this duplicated in cli/version.rs? Could we maybe reuse some of the code?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

env!(DENO_CANARY) macro won't work from build.rs

@@ -476,7 +476,7 @@ impl WebWorker {
ops::signal::deno_signal::init_ops_and_esm(),
ops::tty::deno_tty::init_ops_and_esm(),
ops::http::deno_http_runtime::init_ops_and_esm(),
ops::bootstrap::deno_bootstrap::init_ops_and_esm(),
ops::bootstrap::deno_bootstrap::init_ops_and_esm(None),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like it, I wish we had an easy way to add a custom function just for snapshotting :(

Comment on lines 588 to +594
const {
0: denoVersion,
1: location_,
2: tsVersion,
3: unstableFlag,
4: unstableFeatures,
5: target,
6: v8Version,
8: enableTestingFeaturesFlag,
9: hasNodeModulesDir,
10: maybeBinaryNpmCommandName,
0: location_,
1: unstableFlag,
2: unstableFeatures,
4: enableTestingFeaturesFlag,
5: hasNodeModulesDir,
6: maybeBinaryNpmCommandName,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good!

@littledivy littledivy merged commit 7f3902b into denoland:main Nov 15, 2023
13 checks passed
@bartlomieju bartlomieju deleted the const_snapshot_options branch November 15, 2023 12:25
@littledivy
Copy link
Member Author

/bench startup_nop_trivial

@denobot
Copy link
Collaborator

denobot commented Nov 15, 2023

startup_nop_trivial

time user system relative
node 23.227 ms 17.542 ms 6.911 ms +88.1%
bun 12.351 ms 5.74 ms 7.91 ms best
deno 15.777 ms 10.333 ms 6.687 ms +27.7%
deno-baseline 15.341 ms 9.897 ms 6.644 ms +24.2%

start: Wed, 15 Nov 2023 12:36:22 GMT

id: 9a243363-c0cf-4c82-9417-634d6e187641

server: 050d01f1-b223-4934-8ea5-b47bba41ac3b

kt3k pushed a commit that referenced this pull request Nov 17, 2023
zifeo pushed a commit to metatypedev/deno that referenced this pull request Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Snapshots: move some of the bootstrap options from runtime to snapshot time
3 participants