Skip to content

Commit

Permalink
chore(napi): remove useless de_init
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Dec 16, 2022
1 parent 6e4b16f commit e370dee
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions crates/napi/src/bindgen_runtime/js_values/value_ref.rs
Expand Up @@ -19,13 +19,6 @@ type RefInformation = (
pub(crate) static REFERENCE_MAP: Lazy<PersistedPerInstanceHashMap<*mut c_void, RefInformation>> =
Lazy::new(Default::default);

#[ctor::dtor]
fn de_init() {
REFERENCE_MAP.borrow_mut(|reference_map| {
std::mem::take(reference_map);
});
}

/// ### Experimental feature
///
/// Create a `reference` from `Class` instance.
Expand Down

1 comment on commit e370dee

@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: e370dee Previous: d253135 Ratio
noop#napi-rs 67775254 ops/sec (±0.21%) 64333412 ops/sec (±0.27%) 0.95
noop#JavaScript 593575426 ops/sec (±0.12%) 710798590 ops/sec (±0.12%) 1.20
Plus number#napi-rs 20559230 ops/sec (±0.34%) 20152013 ops/sec (±0.09%) 0.98
Plus number#JavaScript 591742387 ops/sec (±0.11%) 709345084 ops/sec (±0.14%) 1.20
Create buffer#napi-rs 434403 ops/sec (±7.1%) 393871 ops/sec (±8.84%) 0.91
Create buffer#JavaScript 1912513 ops/sec (±5.66%) 2252611 ops/sec (±6.51%) 1.18
createArray#createArrayJson 44965 ops/sec (±0.1%) 39764 ops/sec (±0.1%) 0.88
createArray#create array for loop 8312 ops/sec (±0.2%) 7571 ops/sec (±0.1%) 0.91
createArray#create array with serde trait 8302 ops/sec (±0.13%) 7568 ops/sec (±0.1%) 0.91
getArrayFromJs#get array from json string 17822 ops/sec (±0.24%) 16955 ops/sec (±0.12%) 0.95
getArrayFromJs#get array from serde 10697 ops/sec (±0.03%) 10391 ops/sec (±0.03%) 0.97
getArrayFromJs#get array with for loop 12935 ops/sec (±0.34%) 12489 ops/sec (±0.16%) 0.97
Get Set property#Get Set from native#u32 407599 ops/sec (±4.87%) 439022 ops/sec (±6.28%) 1.08
Get Set property#Get Set from JavaScript#u32 342436 ops/sec (±4.98%) 368164 ops/sec (±6.4%) 1.08
Get Set property#Get Set from native#string 367736 ops/sec (±4.84%) 389939 ops/sec (±5.9%) 1.06
Get Set property#Get Set from JavaScript#string 312699 ops/sec (±4.84%) 351050 ops/sec (±6.15%) 1.12
Async task#spawn task 35836 ops/sec (±1.24%) 36770 ops/sec (±1.97%) 1.03
Async task#ThreadSafeFunction 1692 ops/sec (±4.05%) 1281 ops/sec (±19.64%) 0.76
Async task#Tokio future to Promise 31890 ops/sec (±2.94%) 31603 ops/sec (±3.07%) 0.99
Query#query * 100 1926 ops/sec (±7.12%) 1908 ops/sec (±6.68%) 0.99
Query#query * 1 31956 ops/sec (±0.54%) 30993 ops/sec (±0.51%) 0.97

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

Please sign in to comment.