Skip to content

Commit

Permalink
Adding a setup to investigate the JIT output
Browse files Browse the repository at this point in the history
  • Loading branch information
jwagner committed Jul 23, 2022
1 parent 0d134da commit 8d3d284
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
/e2e
/public
/coverage
/.nyc_output
/.nyc_output
/perf/*.log
/perf/*.cfg
/perf/*.json
18 changes: 18 additions & 0 deletions perf/minimal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// This is a minimal test case for performance investigations

// eslint-disable-next-line @typescript-eslint/no-var-requires
const {createNoise2D} = require('..');

const noise2D = createNoise2D();

for(let i = 0; i < 3; i++) {
console.log('pass', i);
let sum = 0;
for(let y = 0; y < 10; y+=0.1) {
for(let x = 0; x < 10; x+=0.1) {
sum += noise2D(x, y);
}
}
console.log(sum);
}

2 changes: 2 additions & 0 deletions perf/trace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
node --random_seed=1 --hash_seed=1 --print-opt-code --code-comments --trace-deopt --trace-turbo minimal.js

0 comments on commit 8d3d284

Please sign in to comment.