Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Brooooooklyn
Copy link
Member

#[napi::module_init]
fn init() {
  let rt = tokio::runtime::Builder::new_multi_thread()
    .enable_all()
    .on_thread_start(|| {
      println!("tokio thread started");
    })
    .build()
    .unwrap();
  create_custom_tokio_runtime(rt);
}

Copy link
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
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

Benchmark suite Current: 7d0985d Previous: 4544095 Ratio
noop#napi-rs 86845542 ops/sec (±0.28%) 86655278 ops/sec (±0.17%) 1.00
noop#JavaScript 823423576 ops/sec (±0.06%) 822017632 ops/sec (±0.08%) 1.00
Plus number#napi-rs 19999383 ops/sec (±0.33%) 19869921 ops/sec (±0.34%) 0.99
Plus number#JavaScript 822346356 ops/sec (±0.11%) 817902999 ops/sec (±0.23%) 0.99
Create buffer#napi-rs 657181 ops/sec (±12.72%) 644497 ops/sec (±13.42%) 0.98
Create buffer#JavaScript 3283135 ops/sec (±1.77%) 3148359 ops/sec (±2.4%) 0.96
createArray#createArrayJson 54403 ops/sec (±0.71%) 54376 ops/sec (±0.63%) 1.00
createArray#create array for loop 9852 ops/sec (±0.27%) 9623 ops/sec (±0.81%) 0.98
createArray#create array with serde trait 9937 ops/sec (±0.34%) 9908 ops/sec (±0.27%) 1.00
getArrayFromJs#get array from json string 23748 ops/sec (±0.56%) 24113 ops/sec (±0.14%) 1.02
getArrayFromJs#get array from serde 13464 ops/sec (±0.21%) 13295 ops/sec (±0.63%) 0.99
getArrayFromJs#get array with for loop 16090 ops/sec (±0.26%) 15758 ops/sec (±0.44%) 0.98
Get Set property#Get Set from native#u32 579408 ops/sec (±12.87%) 570334 ops/sec (±12.76%) 0.98
Get Set property#Get Set from JavaScript#u32 554018 ops/sec (±2.32%) 545734 ops/sec (±2.54%) 0.99
Get Set property#Get Set from native#string 563060 ops/sec (±12.47%) 565374 ops/sec (±11.53%) 1.00
Get Set property#Get Set from JavaScript#string 521959 ops/sec (±2.05%) 524482 ops/sec (±1.83%) 1.00
Async task#spawn task 26739 ops/sec (±0.38%) 26529 ops/sec (±0.72%) 0.99
Async task#ThreadSafeFunction 8888 ops/sec (±1.53%) 8970 ops/sec (±0.98%) 1.01
Async task#Tokio future to Promise 32141 ops/sec (±1.27%) 32199 ops/sec (±0.79%) 1.00
Query#query * 100 3937 ops/sec (±0.42%) 3966 ops/sec (±1.32%) 1.01
Query#query * 1 27342 ops/sec (±1.82%) 27538 ops/sec (±0.92%) 1.01

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

@Brooooooklyn Brooooooklyn merged commit e3a403b into main Apr 15, 2024
@Brooooooklyn Brooooooklyn deleted the 04-15-feat_napi_allow_user_defined_tokio_runtime branch April 15, 2024 15:58
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