Skip to content

Commit

Permalink
feat: skia chrome/m91, add back mimalloc
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Apr 12, 2021
1 parent b948a33 commit 0420c14
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ thiserror = "1.0"
[target.'cfg(all(unix, not(target_env = "musl"), not(target_arch = "aarch64"), not(target_arch = "arm")))'.dependencies]
jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]}

[target.'cfg(windows)'.dependencies]
mimalloc = {version = "0.1"}

[build-dependencies]
cc = "1"
napi-build = "1"
Expand Down
2 changes: 1 addition & 1 deletion skia
Submodule skia updated 2238 files
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ use sk::SurfaceDataRef;
#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

#[cfg(windows)]
#[global_allocator]
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;

mod ctx;
mod error;
mod font;
Expand Down

1 comment on commit 0420c14

@github-actions
Copy link

Choose a reason for hiding this comment

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

Benchmark

Benchmark suite Current: 0420c14 Previous: b948a33 Ratio
Draw house#@napi-rs/skia 21 ops/sec (±1.03%) 21 ops/sec (±1.32%) 1
Draw house#node-canvas 22 ops/sec (±1.05%) 22 ops/sec (±1.55%) 1
Draw gradient#@napi-rs/skia 19 ops/sec (±0.96%) 20.5 ops/sec (±1.44%) 1.08
Draw gradient#node-canvas 20 ops/sec (±1.51%) 20.6 ops/sec (±3.09%) 1.03

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.