Skip to content

Commit

Permalink
refactor(core): More efficient serde for ES modules in snapshot (deno…
Browse files Browse the repository at this point in the history
…land#17856)

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.

```
// 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

```
  • Loading branch information
bartlomieju committed Feb 21, 2023
1 parent 3479bc7 commit 69c0b05
Show file tree
Hide file tree
Showing 2 changed files with 229 additions and 71 deletions.

0 comments on commit 69c0b05

Please sign in to comment.