Skip to content

Commit

Permalink
fix(cli): log more wasi load errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Feb 8, 2024
1 parent 0205fd9 commit ff2ccc9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cli/src/api/templates/js-binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,18 @@ switch (platform) {
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
try {
nativeBinding = require('./${localName}.wasi.cjs')
} catch {
// ignore
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
console.error(err)
}
}
if (!nativeBinding) {
try {
nativeBinding = require('${pkgName}-wasm32-wasi')
} catch (err) {
console.error(err)
if (process.env.NAPI_RS_FORCE_WASI) {
console.error(err)
}
}
}
}
Expand Down

1 comment on commit ff2ccc9

@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: ff2ccc9 Previous: 0205fd9 Ratio
noop#napi-rs 86709926 ops/sec (±0.17%) 86337196 ops/sec (±0.4%) 1.00
noop#JavaScript 820164614 ops/sec (±0.2%) 819514024 ops/sec (±0.1%) 1.00
Plus number#napi-rs 19519661 ops/sec (±0.14%) 19664851 ops/sec (±0.2%) 1.01
Plus number#JavaScript 819713303 ops/sec (±0.1%) 818126688 ops/sec (±0.09%) 1.00
Create buffer#napi-rs 648012 ops/sec (±13.56%) 653877 ops/sec (±12.12%) 1.01
Create buffer#JavaScript 3117739 ops/sec (±2.11%) 3302959 ops/sec (±2.75%) 1.06
createArray#createArrayJson 54246 ops/sec (±0.42%) 55097 ops/sec (±0.38%) 1.02
createArray#create array for loop 9919 ops/sec (±0.74%) 9934 ops/sec (±0.48%) 1.00
createArray#create array with serde trait 9976 ops/sec (±0.49%) 10030 ops/sec (±0.11%) 1.01
getArrayFromJs#get array from json string 23726 ops/sec (±0.34%) 24048 ops/sec (±0.35%) 1.01
getArrayFromJs#get array from serde 13507 ops/sec (±0.07%) 13454 ops/sec (±1.69%) 1.00
getArrayFromJs#get array with for loop 16799 ops/sec (±0.29%) 16685 ops/sec (±0.73%) 0.99
Get Set property#Get Set from native#u32 574051 ops/sec (±13.57%) 565555 ops/sec (±12.75%) 0.99
Get Set property#Get Set from JavaScript#u32 548980 ops/sec (±2.27%) 533689 ops/sec (±2.5%) 0.97
Get Set property#Get Set from native#string 562474 ops/sec (±11.94%) 566199 ops/sec (±11.26%) 1.01
Get Set property#Get Set from JavaScript#string 520070 ops/sec (±2%) 527709 ops/sec (±2.04%) 1.01
Async task#spawn task 26841 ops/sec (±0.67%) 26569 ops/sec (±0.43%) 0.99
Async task#ThreadSafeFunction 9248 ops/sec (±1.12%) 9019 ops/sec (±1.14%) 0.98
Async task#Tokio future to Promise 32039 ops/sec (±0.75%) 32673 ops/sec (±1.46%) 1.02
Query#query * 100 3873 ops/sec (±1.27%) 3822 ops/sec (±1.61%) 0.99
Query#query * 1 28574 ops/sec (±1.13%) 27327 ops/sec (±1.77%) 0.96

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

Please sign in to comment.