Skip to content

Instantly share code, notes, and snippets.

@stella3d
Last active January 1, 2019 10:02
Show Gist options
  • Save stella3d/60c2da8c7d94d361520666ed4d6d49bd to your computer and use it in GitHub Desktop.
Save stella3d/60c2da8c7d94d361520666ed4d6d49bd to your computer and use it in GitHub Desktop.

These benchmarks compare the results for delaunator before and after a refactor of the underlying data representation.

All tests were run on a 2018 Razer Blade with an intel i7-8750H cpu, using node.js v10.15.0.

"before" results were tested on current master branch of delaunator.

"after" results were tested on my soa (structure of arrays) branch

Comparison

uniform:

20000 average: before 11.8ms, after 5.318ms - 122% faster

1000000 average: before 938.27ms, after 466.973ms - %100 faster

gaussian:

20000: before 10.405ms, after 4.787ms - %117 faster

1000000: before 899.979ms, after 459.642ms - %96 faster

grid:

20000 average: before 9.665ms, after 5.528ms - 75% faster

1000000 average: before 835.14ms, after 499.08ms - 67% faster

degenerate:

20000 average: before 4.638ms, after 3.05ms- 52% faster

1000000 average: before 323.286ms, after 124.749ms - %159 faster


Below here are per-run results for each part of the comparison.

Using new parallel arrays approach

uniform:

20000: 6.255ms, 5.002ms, 4.701ms

average: 5.318ms

1000000: 488.443ms, 450.989ms, 461.488ms

average: 466.973ms

gaussian:

20000: 4.831ms, 4.673ms, 4.857ms

average: 4.787ms

1000000: 517.156ms, 425.174ms, 436.596ms

average: 459.642ms

grid:

20000: 5.680ms, 5.472ms, 5.432ms

average: 5.528

1000000: 542.662ms, 476.904ms, 477.676

average: 499.08

degenerate:

20000: 2.670ms, 4.504ms, 1.976ms

average: 3.05ms

1000000: 182.673ms, 94.173ms, 97.401ms

average: 124.749ms

Using old single array approach

uniform:

20000: 14.652, 10.382, 10.365

average: 11.8ms

1000000: 925.398, 953.461, 936.248

average: 938.27ms

gaussian:

20000: 9.809, 11.050, 10.357

average : 10.405ms

1000000: 910.472, 875.217, 914.248

average : 899.979ms

grid:

20000: 9.78, 9.522, 9.694

average : 9.665ms

1000000: 842.117, 847.033, 816.269

average : 835.14ms

degenerate:

20000: 4.947, 4.361, 4.607

average : 4.638ms

1000000: 327.96, 360.135, 281.765

average : 323.286ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment