fix(napi): memory leak in PromiseRaw callbacks#2348
Merged
Brooooooklyn merged 1 commit intomainfrom Nov 7, 2024
Merged
Conversation
Member
Author
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @Brooooooklyn and the rest of your teammates on |
Contributor
There was a problem hiding this comment.
Benchmark
Details
| Benchmark suite | Current: 595b5e1 | Previous: cf23055 | Ratio |
|---|---|---|---|
noop#napi-rs |
78324411 ops/sec (±0.49%) |
86709024 ops/sec (±0.3%) |
1.11 |
noop#JavaScript |
821883899 ops/sec (±0.28%) |
821155810 ops/sec (±0.18%) |
1.00 |
Plus number#napi-rs |
22537174 ops/sec (±0.2%) |
23526928 ops/sec (±0.16%) |
1.04 |
Plus number#JavaScript |
821971236 ops/sec (±0.1%) |
821711105 ops/sec (±0.1%) |
1.00 |
Create buffer#napi-rs |
663742 ops/sec (±12.95%) |
662733 ops/sec (±12.28%) |
1.00 |
Create buffer#JavaScript |
3084511 ops/sec (±6.4%) |
4100841 ops/sec (±3.02%) |
1.33 |
createArray#createArrayJson |
54781 ops/sec (±0.6%) |
54379 ops/sec (±0.17%) |
0.99 |
createArray#create array for loop |
9861 ops/sec (±0.45%) |
9784 ops/sec (±1.37%) |
0.99 |
createArray#create array with serde trait |
10015 ops/sec (±0.16%) |
9983 ops/sec (±0.55%) |
1.00 |
getArrayFromJs#get array from json string |
23838 ops/sec (±0.43%) |
23636 ops/sec (±0.42%) |
0.99 |
getArrayFromJs#get array from serde |
13607 ops/sec (±0.6%) |
13655 ops/sec (±0.18%) |
1.00 |
getArrayFromJs#get array with for loop |
16199 ops/sec (±0.07%) |
16202 ops/sec (±0.04%) |
1.00 |
Get Set property#Get Set from native#u32 |
574823 ops/sec (±12.3%) |
572162 ops/sec (±13.06%) |
1.00 |
Get Set property#Get Set from JavaScript#u32 |
549935 ops/sec (±2.24%) |
555672 ops/sec (±2.5%) |
1.01 |
Get Set property#Get Set from native#string |
567962 ops/sec (±11.27%) |
570461 ops/sec (±12.07%) |
1.00 |
Get Set property#Get Set from JavaScript#string |
522233 ops/sec (±1.96%) |
523291 ops/sec (±2%) |
1.00 |
Async task#spawn task |
27122 ops/sec (±0.27%) |
26756 ops/sec (±0.73%) |
0.99 |
Async task#ThreadSafeFunction |
9489 ops/sec (±1.07%) |
9577 ops/sec (±0.8%) |
1.01 |
Async task#Tokio future to Promise |
31578 ops/sec (±0.86%) |
32556 ops/sec (±0.9%) |
1.03 |
Query#query * 100 |
3579 ops/sec (±0.52%) |
3568 ops/sec (±0.72%) |
1.00 |
Query#query * 1 |
26209 ops/sec (±1.11%) |
26816 ops/sec (±0.59%) |
1.02 |
This comment was automatically generated by workflow using github-action-benchmark.
Member
Author
Merge activity
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.