Benchmarks of Scott-Encoded versus native datatypes.
Allocates a binary tree of 2 ** n
depth and counts its nodes.
n | native.hs | scott.hs | native.js | scott.js |
---|---|---|---|---|
0 | 0.03s | 0.023s | 0.044s | 0.05s |
1 | 0.023s | 0.024s | 0.036s | 0.046s |
2 | 0.025s | 0.025s | 0.038s | 0.045s |
3 | 0.023s | 0.022s | 0.037s | 0.045s |
4 | 0.026s | 0.026s | 0.037s | 0.044s |
5 | 0.025s | 0.024s | 0.037s | 0.045s |
6 | 0.022s | 0.025s | 0.037s | 0.043s |
7 | 0.023s | 0.025s | 0.037s | 0.045s |
8 | 0.027s | 0.026s | 0.038s | 0.044s |
9 | 0.024s | 0.024s | 0.036s | 0.045s |
10 | 0.022s | 0.024s | 0.039s | 0.045s |
11 | 0.023s | 0.022s | 0.037s | 0.046s |
12 | 0.026s | 0.027s | 0.041s | 0.049s |
13 | 0.025s | 0.025s | 0.04s | 0.052s |
14 | 0.024s | 0.026s | 0.04s | 0.057s |
15 | 0.025s | 0.028s | 0.042s | 0.063s |
16 | 0.024s | 0.027s | 0.045s | 0.079s |
17 | 0.024s | 0.022s | 0.05s | 0.102s |
18 | 0.022s | 0.021s | 0.059s | 0.154s |
19 | 0.035s | 0.025s | 0.071s | 0.231s |
20 | 0.048s | 0.038s | 0.133s | 0.363s |
21 | 0.072s | 0.043s | 0.19s | 1.167s |
22 | 0.117s | 0.074s | 0.3s | 1.668s |
23 | 0.197s | 0.115s | 0.602s | 4.94s |
24 | 0.362s | 0.213s | 1.178s | err |
25 | 0.702s | 0.398s | 2.488s | err |
26 | 1.385s | 0.756s | err | err |
27 | 2.739s | 1.488s | err | err |
28 | 5.79s | 2.948s | err | err |
29 | 11.451s | 5.888s | err | err |
30 | 23.042s | 12.257s | err | err |
31 | 45.219s | 24.44s | err | err |