Skip to content

chore(napi): deprecate Env::create_reference#2347

Merged
Brooooooklyn merged 1 commit intomainfrom
11-07-chore_napi_deprecate_env_create_reference
Nov 7, 2024
Merged

chore(napi): deprecate Env::create_reference#2347
Brooooooklyn merged 1 commit intomainfrom
11-07-chore_napi_deprecate_env_create_reference

Conversation

@Brooooooklyn
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @Brooooooklyn and the rest of your teammates on Graphite Graphite

Copy link
Copy Markdown
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Benchmark

Details
Benchmark suite Current: 33164be Previous: f2377e2 Ratio
noop#napi-rs 86454072 ops/sec (±0.15%) 86502656 ops/sec (±0.15%) 1.00
noop#JavaScript 819929189 ops/sec (±0.11%) 818277384 ops/sec (±0.1%) 1.00
Plus number#napi-rs 18553882 ops/sec (±0.82%) 22921082 ops/sec (±0.5%) 1.24
Plus number#JavaScript 817902544 ops/sec (±0.1%) 815170832 ops/sec (±0.24%) 1.00
Create buffer#napi-rs 649297 ops/sec (±12.02%) 617986 ops/sec (±13.66%) 0.95
Create buffer#JavaScript 3267863 ops/sec (±2.05%) 3195858 ops/sec (±2.46%) 0.98
createArray#createArrayJson 53429 ops/sec (±1.09%) 53212 ops/sec (±0.46%) 1.00
createArray#create array for loop 9849 ops/sec (±0.36%) 9895 ops/sec (±0.59%) 1.00
createArray#create array with serde trait 9890 ops/sec (±1.41%) 9931 ops/sec (±0.58%) 1.00
getArrayFromJs#get array from json string 23244 ops/sec (±0.98%) 23467 ops/sec (±0.55%) 1.01
getArrayFromJs#get array from serde 13030 ops/sec (±0.22%) 13617 ops/sec (±0.35%) 1.05
getArrayFromJs#get array with for loop 15949 ops/sec (±0.39%) 15974 ops/sec (±0.46%) 1.00
Get Set property#Get Set from native#u32 580750 ops/sec (±12.33%) 543258 ops/sec (±13.02%) 0.94
Get Set property#Get Set from JavaScript#u32 555847 ops/sec (±2.39%) 538847 ops/sec (±2.45%) 0.97
Get Set property#Get Set from native#string 571149 ops/sec (±11.45%) 564204 ops/sec (±12.3%) 0.99
Get Set property#Get Set from JavaScript#string 524998 ops/sec (±1.85%) 521239 ops/sec (±1.86%) 0.99
Async task#spawn task 26864 ops/sec (±0.8%) 26577 ops/sec (±0.66%) 0.99
Async task#ThreadSafeFunction 9548 ops/sec (±0.92%) 9339 ops/sec (±0.83%) 0.98
Async task#Tokio future to Promise 32225 ops/sec (±0.71%) 32056 ops/sec (±0.82%) 0.99
Query#query * 100 3582 ops/sec (±0.85%) 3554 ops/sec (±0.43%) 0.99
Query#query * 1 26872 ops/sec (±0.77%) 26009 ops/sec (±0.87%) 0.97

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

@Brooooooklyn Brooooooklyn merged commit cf23055 into main Nov 7, 2024
@Brooooooklyn Brooooooklyn deleted the 11-07-chore_napi_deprecate_env_create_reference branch November 7, 2024 05:05
Brooooooklyn added a commit to Brooooooklyn/canvas that referenced this pull request Nov 7, 2024
There 2 leak points in the `Image` class.

1. The `Env::create_reference` was wrong in NAPI-RS, related pr: napi-rs/napi-rs#2347, change to the `Ref::new` can resolve it.
2. The `PromiseRaw::catch` callback was leaked, it cause the whole `Image` objects not be GCed, it was fixed in napi-rs/napi-rs#2348
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.

1 participant