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

refactor(core): More efficient serde for ES modules in snapshot #17856

Merged
merged 7 commits into from
Feb 21, 2023

Conversation

bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Feb 21, 2023

Instead of relying on "serde_v8" which is very inefficient in serializing enums, I'm
hand rolling serde for "ModuleMap" data that is stored in the V8 snapshot to make
ES modules snapshottable.

Will post number comparison later, but I don't expect more than 5-10% improvement in
startup time.

EDIT: Benchmark results:

// this branch
Benchmark #2: ./target/release/deno run empty.js

  Time (mean ± σ):      21.4 ms ±   0.9 ms    [User: 15.6 ms, System: 6.4 ms]

  Range (min … max):    20.2 ms …  24.4 ms

// main branch
Benchmark #2: ./target/release/deno run empty.js

  Time (mean ± σ):      23.1 ms ±   1.2 ms    [User: 17.0 ms, System: 6.2 ms]

  Range (min … max):    21.0 ms …  26.0 ms

@bartlomieju bartlomieju marked this pull request as ready for review February 21, 2023 17:28
core/modules.rs Outdated Show resolved Hide resolved
@bartlomieju bartlomieju merged commit 69c0b05 into denoland:main Feb 21, 2023
@bartlomieju bartlomieju deleted the faster_startup_core branch February 21, 2023 20:12
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.

None yet

2 participants