Skip to content

Commit

Permalink
Fix memory testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Mar 21, 2023
1 parent c74ae9b commit 4d35563
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion memory-testing/test-util.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ export async function createSuite(testFile, maxMemoryUsage) {
stats.on('data', (d) => {
const { memory_stats } = JSON.parse(d.toString('utf8'))
if (Date.now() - initialDate > 10000 && !shouldAssertMemoryUsage) {
resolve()
initialMemoryUsage = memory_stats.usage
shouldAssertMemoryUsage = true
resolve()
}
if (shouldAssertMemoryUsage && memory_stats?.usage) {
const memoryGrowth = memory_stats.usage - initialMemoryUsage
Expand Down

1 comment on commit 4d35563

@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: 4d35563 Previous: 3b831f4 Ratio
noop#napi-rs 63676597 ops/sec (±0.48%) 49256299 ops/sec (±1.23%) 0.77
noop#JavaScript 594242274 ops/sec (±0.11%) 729666474 ops/sec (±0.95%) 1.23
Plus number#napi-rs 20000599 ops/sec (±0.19%) 14677733 ops/sec (±0.96%) 0.73
Plus number#JavaScript 592508636 ops/sec (±0.16%) 696004559 ops/sec (±1.06%) 1.17
Create buffer#napi-rs 415994 ops/sec (±7.07%) 316631 ops/sec (±9.79%) 0.76
Create buffer#JavaScript 2014589 ops/sec (±5.49%) 1472552 ops/sec (±6.88%) 0.73
createArray#createArrayJson 45350.5 ops/sec (±0.12%) 32700 ops/sec (±0.99%) 0.72
createArray#create array for loop 8563.3 ops/sec (±0.1%) 6001 ops/sec (±0.88%) 0.70
createArray#create array with serde trait 8563.4 ops/sec (±0.27%) 6151 ops/sec (±0.77%) 0.72
getArrayFromJs#get array from json string 17666 ops/sec (±0.17%) 14300 ops/sec (±0.95%) 0.81
getArrayFromJs#get array from serde 11419 ops/sec (±0.05%) 8369 ops/sec (±1.05%) 0.73
getArrayFromJs#get array with for loop 13404 ops/sec (±0.15%) 10193 ops/sec (±1.25%) 0.76
Get Set property#Get Set from native#u32 432157 ops/sec (±7.14%) 387711 ops/sec (±8.4%) 0.90
Get Set property#Get Set from JavaScript#u32 368098 ops/sec (±8.46%) 341191 ops/sec (±9.69%) 0.93
Get Set property#Get Set from native#string 397199 ops/sec (±11.26%) 371833 ops/sec (±4.07%) 0.94
Get Set property#Get Set from JavaScript#string 364364 ops/sec (±2.52%) 310627 ops/sec (±14.99%) 0.85
Async task#spawn task 33835 ops/sec (±1.75%) 27194 ops/sec (±3.62%) 0.80
Async task#ThreadSafeFunction 3305 ops/sec (±2.61%) 1493 ops/sec (±3.3%) 0.45
Async task#Tokio future to Promise 31909 ops/sec (±1.37%) 27053 ops/sec (±2%) 0.85
Query#query * 100 1999 ops/sec (±2.81%) 1546 ops/sec (±2.17%) 0.77
Query#query * 1 29890 ops/sec (±3.07%) 21866 ops/sec (±2.53%) 0.73

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

Please sign in to comment.