Skip to content

Commit dbd360d

Browse files
committed
xxx: update benchmarks
1 parent 4fbc751 commit dbd360d

4 files changed

Lines changed: 15 additions & 10 deletions

File tree

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ As such, both of these benchmarks are actually just running in the interpreter.
4848
**Try it for yourself**: [Source code](tests/data/iterate-for-no-reason-001.js)
4949
| Engine | Time Taken |
5050
| ----------------------- | -------------------------------------------------------------- |
51-
| Bali (Interpreter) | 3.9ms (best case) - 5.9ms (worst case) |
52-
| Bali (JIT) | 3.9ms (best case) - 6.0ms (worst case) |
53-
54-
This proves that the JIT barely worsens the worst case scenario.
51+
| Bali (Interpreter) | 3.4ms (best case) - 7.9ms (worst case) |
52+
| Bali (JIT) | 3.3ms (best case) - 5.3ms (worst case) |
5553

5654
## Finding a substring in a moderately large string
5755
Bali's string-find function (`String.prototype.indexOf`) is SIMD-accelerated, and as such, is pretty fast.
@@ -63,17 +61,17 @@ As such, both of these benchmarks are actually just running in the interpreter.
6361
**Try it for yourself**: [Source code](tests/data/string-find-001.js)
6462
| Engine | Time Taken |
6563
| -------------------------- | -------------------------------------------- |
66-
| Bali (Interpreter) | 4.1ms (best case) - 6.1ms (worst case) |
67-
| Bali (JIT) | 4.1ms (best case) - 7.1ms (worst case) |
64+
| Bali (Interpreter) | 3.5ms (best case) - 5.8ms (worst case) |
65+
| Bali (JIT) | 3.5ms (best case) - 5.5ms (worst case) |
6866

6967
## JIT-triggering microbenchmark
7068
This script is intentionally designed to make Bali's profiling mechanism catch onto it and optimize it.
7169

7270
**Try it for yourself**: [Source code](tests/data/trigger-jit-001.js)
7371
| Engine | Time Taken |
7472
| -------------------------- | -------------------------------------------- |
75-
| Bali (Interpreter) | 586.9ms (best case) - 601.3ms (worst case) |
76-
| Bali (JIT) | 356.7ms (best case) - 374.5ms (worst case) |
73+
| Bali (Interpreter) | 268.5ms (best case) - 275.5ms (worst case) |
74+
| Bali (JIT) | 162.4ms (best case) - 169.2ms (worst case) |
7775

7876
Here, the JIT is **1.65x** faster than the interpreter!
7977

benchmarks/expensive-loop.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env sh
22
# Checking how well Bali, SpiderMonkey, Boa and QuickJS can run an expensive loop
33
# Boa times out, so it is not included.
4-
hyperfine "./bin/balde tests/data/iterate-for-no-reason-001.js" "./bin/balde tests/data/iterate-for-no-reason-001.js -Z" "qjs tests/data/iterate-for-no-reason-001.js" --shell=none --warmup=10
4+
hyperfine "./balde tests/data/iterate-for-no-reason-001.js" "./balde tests/data/iterate-for-no-reason-001.js --disable-jit" "qjs tests/data/iterate-for-no-reason-001.js" --shell=none --warmup=10

benchmarks/script/patch.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66

77
function expensiveLoop()
88
{
9+
var i = 0;
10+
while (i < 65536)
11+
{
12+
i = 65536;
13+
}
14+
15+
return i;
916
}
1017

1118
// NOTE: madhyasthal triggers at i < 1471

benchmarks/string-find.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env sh
22
# Checking how many times Bali, SpiderMonkey, Boa and QuickJS can search a medium-sized string for a needle.
3-
hyperfine "./bin/balde tests/data/string-find-001.js -Z" "./bin/balde tests/data/string-find-001.js" "qjs tests/data/string-find-001.js" --shell=none --warmup=100
3+
hyperfine "./balde tests/data/string-find-001.js --disable-jit" "./balde tests/data/string-find-001.js" "qjs tests/data/string-find-001.js" --shell=none --warmup=100

0 commit comments

Comments
 (0)