Skip to content

Instantly share code, notes, and snippets.

@hjanetzek
Last active November 27, 2018 17:22
Show Gist options
  • Save hjanetzek/3ebc34b6386f0340717ff09b643e0140 to your computer and use it in GitHub Desktop.
Save hjanetzek/3ebc34b6386f0340717ff09b643e0140 to your computer and use it in GitHub Desktop.

Timing

BenchTileBuilder

  • using current bubble-wrap-style.zip and tile.mvt from our benchmarks
./bench/benchTileBuilder.out --benchmark_repetitions=4

NoJS

All JS functions replaced with some default values that should also build the same set of features - so by sight this should be the baseline:

-----------------------------------------------------------------------------------------
Benchmark                                                  Time           CPU Iterations
-----------------------------------------------------------------------------------------
DUKTileBuilderFixture/DUKTileBuilderBench          17351743 ns   17351401 ns         40
DUKTileBuilderFixture/DUKTileBuilderBench          17234636 ns   17234096 ns         40
DUKTileBuilderFixture/DUKTileBuilderBench          17366908 ns   17366422 ns         40
DUKTileBuilderFixture/DUKTileBuilderBench          17242105 ns   17242059 ns         40
DUKTileBuilderFixture/DUKTileBuilderBench_mean     17298848 ns   17298494 ns         40
DUKTileBuilderFixture/DUKTileBuilderBench_median   17296924 ns   17296730 ns         40
DUKTileBuilderFixture/DUKTileBuilderBench_stddev      70173 ns      70108 ns         40

Before

(Duktape)

TileBuilderFixture/TileBuilderBench          40854124 ns   40853861 ns         13
TileBuilderFixture/TileBuilderBench          40954230 ns   40953137 ns         13
TileBuilderFixture/TileBuilderBench          40691041 ns   40690751 ns         13
TileBuilderFixture/TileBuilderBench          41040318 ns   41032737 ns         13
TileBuilderFixture/TileBuilderBench_mean     40884928 ns   40882622 ns         13
TileBuilderFixture/TileBuilderBench_median   40904177 ns   40903499 ns         13
TileBuilderFixture/TileBuilderBench_stddev     149989 ns     147364 ns         13

Javascriptcontext

(Duktape)

TileBuilderFixture/TileBuilderBench          42015610 ns   42011324 ns         13
TileBuilderFixture/TileBuilderBench          41824282 ns   41820083 ns         13
TileBuilderFixture/TileBuilderBench          42004907 ns   41997206 ns         13
TileBuilderFixture/TileBuilderBench          41969761 ns   41965571 ns         13
TileBuilderFixture/TileBuilderBench_mean     41953640 ns   41948546 ns         13
TileBuilderFixture/TileBuilderBench_median   41987334 ns   41981389 ns         13
TileBuilderFixture/TileBuilderBench_stddev      88434 ns      87752 ns         13

(JSCore)

TileBuilderFixture/TileBuilderBench          63204869 ns   63114755 ns          9
TileBuilderFixture/TileBuilderBench          62422725 ns   62374911 ns          9
TileBuilderFixture/TileBuilderBench          62756347 ns   62679804 ns          9
TileBuilderFixture/TileBuilderBench          63236968 ns   63194753 ns          9
TileBuilderFixture/TileBuilderBench_mean     62905227 ns   62841056 ns          9
TileBuilderFixture/TileBuilderBench_median   62980608 ns   62897279 ns          9
TileBuilderFixture/TileBuilderBench_stddev     389363 ns     384407 ns          9

Templated

DUKTileBuilderFixture/DUKTileBuilderBench          41534263 ns   41514517 ns         13
DUKTileBuilderFixture/DUKTileBuilderBench          41084768 ns   41084521 ns         13
DUKTileBuilderFixture/DUKTileBuilderBench          41214595 ns   41212890 ns         13
DUKTileBuilderFixture/DUKTileBuilderBench          41171231 ns   41170991 ns         13
DUKTileBuilderFixture/DUKTileBuilderBench_mean     41251214 ns   41245730 ns         13
DUKTileBuilderFixture/DUKTileBuilderBench_median   41192913 ns   41191940 ns         13
DUKTileBuilderFixture/DUKTileBuilderBench_stddev     196264 ns     186993 ns         13

JSCTileBuilderFixture/JSCTileBuilderBench          63528577 ns   63456074 ns         10
JSCTileBuilderFixture/JSCTileBuilderBench          64506407 ns   64469978 ns         10
JSCTileBuilderFixture/JSCTileBuilderBench          63767489 ns   63740523 ns         10
JSCTileBuilderFixture/JSCTileBuilderBench          63183090 ns   63141379 ns         10
JSCTileBuilderFixture/JSCTileBuilderBench_mean     63746391 ns   63701988 ns         10
JSCTileBuilderFixture/JSCTileBuilderBench_median   63648033 ns   63598298 ns         10
JSCTileBuilderFixture/JSCTileBuilderBench_stddev     560601 ns     567465 ns         10

Duktape optimized

DUKTileBuilderFixture/DUKTileBuilderBench          37424373 ns   37424125 ns         19
DUKTileBuilderFixture/DUKTileBuilderBench          37672170 ns   37671321 ns         19
DUKTileBuilderFixture/DUKTileBuilderBench          37443997 ns   37442352 ns         19
DUKTileBuilderFixture/DUKTileBuilderBench          37437410 ns   37436345 ns         19
DUKTileBuilderFixture/DUKTileBuilderBench_mean     37494488 ns   37493536 ns         19
DUKTileBuilderFixture/DUKTileBuilderBench_median   37440704 ns   37439349 ns         19
DUKTileBuilderFixture/DUKTileBuilderBench_stddev     118736 ns     118766 ns         19

JSCTileBuilderFixture/JSCTileBuilderBench          63871969 ns   63764277 ns         10
JSCTileBuilderFixture/JSCTileBuilderBench          63345369 ns   63305692 ns         10
JSCTileBuilderFixture/JSCTileBuilderBench          63835797 ns   63775202 ns         10
JSCTileBuilderFixture/JSCTileBuilderBench          63332658 ns   63281828 ns         10
JSCTileBuilderFixture/JSCTileBuilderBench_mean     63596448 ns   63531750 ns         10
JSCTileBuilderFixture/JSCTileBuilderBench_median   63590583 ns   63534985 ns         10
JSCTileBuilderFixture/JSCTileBuilderBench_stddev     297671 ns     275015 ns         10

BenchStyleContext

Before

./bench/benchStyleContext.out –benchmark_repetitions=4 (Just getting a feature.property via JS)

JSGetPropertyBenchFixture/JSGetPropertyBench                      1152 ns       1152 ns     534949
JSGetPropertyBenchFixture/JSGetPropertyBench                      1162 ns       1162 ns     534949
JSGetPropertyBenchFixture/JSGetPropertyBench                      1139 ns       1139 ns     534949
JSGetPropertyBenchFixture/JSGetPropertyBench                      1144 ns       1144 ns     534949
JSGetPropertyBenchFixture/JSGetPropertyBench_mean                 1149 ns       1149 ns     534949
JSGetPropertyBenchFixture/JSGetPropertyBench_median               1148 ns       1148 ns     534949
JSGetPropertyBenchFixture/JSGetPropertyBench_stddev                 10 ns         10 ns     534949

(Direct Feature.props.get() -- it's always the same in below tests)
DirectGetPropertyBenchFixture/DirectGetPropertyBench                59 ns         59 ns   10988357
DirectGetPropertyBenchFixture/DirectGetPropertyBench                59 ns         59 ns   10988357
DirectGetPropertyBenchFixture/DirectGetPropertyBench                58 ns         58 ns   10988357
DirectGetPropertyBenchFixture/DirectGetPropertyBench                58 ns         58 ns   10988357
DirectGetPropertyBenchFixture/DirectGetPropertyBench_mean           58 ns         58 ns   10988357
DirectGetPropertyBenchFixture/DirectGetPropertyBench_median         58 ns         58 ns   10988357
DirectGetPropertyBenchFixture/DirectGetPropertyBench_stddev          1 ns          1 ns   10988357

Javascriptcontext

(JSCore)

JSGetPropertyBenchFixture/JSGetPropertyBench                      3891 ns       3884 ns     179591
JSGetPropertyBenchFixture/JSGetPropertyBench                      3903 ns       3901 ns     179591
JSGetPropertyBenchFixture/JSGetPropertyBench                      3889 ns       3887 ns     179591
JSGetPropertyBenchFixture/JSGetPropertyBench                      3917 ns       3909 ns     179591
JSGetPropertyBenchFixture/JSGetPropertyBench_mean                 3900 ns       3895 ns     179591
JSGetPropertyBenchFixture/JSGetPropertyBench_median               3897 ns       3894 ns     179591
JSGetPropertyBenchFixture/JSGetPropertyBench_stddev                 13 ns         12 ns     179591

Templated

DuktapeGetPropertyFixture/DuktapeGetPropertyBench              1174 ns       1174 ns     608412
DuktapeGetPropertyFixture/DuktapeGetPropertyBench              1150 ns       1150 ns     608412
DuktapeGetPropertyFixture/DuktapeGetPropertyBench              1162 ns       1162 ns     608412
DuktapeGetPropertyFixture/DuktapeGetPropertyBench              1155 ns       1155 ns     608412
DuktapeGetPropertyFixture/DuktapeGetPropertyBench_mean         1160 ns       1160 ns     608412
DuktapeGetPropertyFixture/DuktapeGetPropertyBench_median       1158 ns       1158 ns     608412
DuktapeGetPropertyFixture/DuktapeGetPropertyBench_stddev         10 ns         10 ns     608412

JSCoreGetPropertyFixture/JSCoreGetPropertyBench                3774 ns       3771 ns     182480
JSCoreGetPropertyFixture/JSCoreGetPropertyBench                3814 ns       3811 ns     182480
JSCoreGetPropertyFixture/JSCoreGetPropertyBench                3780 ns       3777 ns     182480
JSCoreGetPropertyFixture/JSCoreGetPropertyBench                3799 ns       3796 ns     182480
JSCoreGetPropertyFixture/JSCoreGetPropertyBench_mean           3792 ns       3789 ns     182480
JSCoreGetPropertyFixture/JSCoreGetPropertyBench_median         3790 ns       3787 ns     182480
JSCoreGetPropertyFixture/JSCoreGetPropertyBench_stddev           18 ns         18 ns     182480

Duktape optimized

DuktapeGetPropertyFixture/DuktapeGetPropertyBench               756 ns        756 ns     921498
DuktapeGetPropertyFixture/DuktapeGetPropertyBench               759 ns        759 ns     921498
DuktapeGetPropertyFixture/DuktapeGetPropertyBench               758 ns        758 ns     921498
DuktapeGetPropertyFixture/DuktapeGetPropertyBench               764 ns        764 ns     921498
DuktapeGetPropertyFixture/DuktapeGetPropertyBench_mean          759 ns        759 ns     921498
DuktapeGetPropertyFixture/DuktapeGetPropertyBench_median        758 ns        758 ns     921498
DuktapeGetPropertyFixture/DuktapeGetPropertyBench_stddev          3 ns          3 ns     921498

JSCoreGetPropertyFixture/JSCoreGetPropertyBench                3982 ns       3978 ns     176138
JSCoreGetPropertyFixture/JSCoreGetPropertyBench                3951 ns       3948 ns     176138
JSCoreGetPropertyFixture/JSCoreGetPropertyBench                3969 ns       3966 ns     176138
JSCoreGetPropertyFixture/JSCoreGetPropertyBench                3980 ns       3978 ns     176138
JSCoreGetPropertyFixture/JSCoreGetPropertyBench_mean           3970 ns       3968 ns     176138
JSCoreGetPropertyFixture/JSCoreGetPropertyBench_median         3974 ns       3972 ns     176138
JSCoreGetPropertyFixture/JSCoreGetPropertyBench_stddev           14 ns         14 ns     176138

Allocations

Using fixed iteration in benchmark to compare allocations

Javascriptcontext

(JSSore)

JSGetPropertyBenchFixture/JSGetPropertyBench/iterations:10000             34158 ns       8154 ns      10000
JSGetPropertyBenchFixture/JSGetPropertyBench/iterations:10000              8108 ns       8088 ns      10000
JSGetPropertyBenchFixture/JSGetPropertyBench/iterations:10000              8148 ns       8127 ns      10000
JSGetPropertyBenchFixture/JSGetPropertyBench/iterations:10000              8259 ns       8182 ns      10000
JSGetPropertyBenchFixture/JSGetPropertyBench/iterations:10000_mean        14668 ns       8137 ns      10000
JSGetPropertyBenchFixture/JSGetPropertyBench/iterations:10000_median       8203 ns       8140 ns      10000
JSGetPropertyBenchFixture/JSGetPropertyBench/iterations:10000_stddev      12993 ns         40 ns      10000
>>> heaptrack --analyze "/home/jeff/work/tangram-es/build/debug/heaptrack.benchStyleContext.out.27863.zst"

debuggee:
./bench/benchStyleContext.out --benchmark_repetitions=4 --benchmark_filter=JS
total runtime:
0.59s
calls to allocation functions:
80547 (136520/s)
temporary allocations:
40143 (49.84%, 68038/s)
bytes allocated in total (ignoring deallocations):
2.81 MB (4.8 MB/s)

Templated

heaptrack ./bench/benchStyleContext.out --benchmark_repetitions=4 --benchmark_filter=JSCore
JSCoreGetPropertyFixture/JSCoreGetPropertyBench/iterations:10000             31444 ns       7011 ns      10000
JSCoreGetPropertyFixture/JSCoreGetPropertyBench/iterations:10000              6801 ns       6788 ns      10000
JSCoreGetPropertyFixture/JSCoreGetPropertyBench/iterations:10000              6771 ns       6757 ns      10000
JSCoreGetPropertyFixture/JSCoreGetPropertyBench/iterations:10000              6729 ns       6713 ns      10000
JSCoreGetPropertyFixture/JSCoreGetPropertyBench/iterations:10000_mean        12936 ns       6817 ns      10000
JSCoreGetPropertyFixture/JSCoreGetPropertyBench/iterations:10000_median       6786 ns       6773 ns      10000
JSCoreGetPropertyFixture/JSCoreGetPropertyBench/iterations:10000_stddev      12338 ns        133 ns      10000
>>> heaptrack --analyze "/home/jeff/work/tangram-es/build/debug/heaptrack.benchStyleContext.out.30636.zst"

debuggee:
./bench/benchStyleContext.out --benchmark_repetitions=4 --benchmark_filter=JSCore
total runtime:
0.544s
calls to allocation functions:
40562 (74562/s)
temporary allocations:
40135 (98.95%, 73777/s)
bytes allocated in total (ignoring deallocations):
1.85 MB (3.4 MB/s)
heaptrack ./bench/benchStyleContext.out --benchmark_repetitions=4 --benchmark_filter=Duk
DuktapeGetPropertyFixture/DuktapeGetPropertyBench/iterations:10000             12820 ns       7228 ns      10000
DuktapeGetPropertyFixture/DuktapeGetPropertyBench/iterations:10000              7322 ns       7173 ns      10000
DuktapeGetPropertyFixture/DuktapeGetPropertyBench/iterations:10000              7225 ns       7208 ns      10000
DuktapeGetPropertyFixture/DuktapeGetPropertyBench/iterations:10000              7257 ns       7239 ns      10000
DuktapeGetPropertyFixture/DuktapeGetPropertyBench/iterations:10000_mean         8656 ns       7212 ns      10000
DuktapeGetPropertyFixture/DuktapeGetPropertyBench/iterations:10000_median       7289 ns       7218 ns      10000
DuktapeGetPropertyFixture/DuktapeGetPropertyBench/iterations:10000_stddev       2776 ns         29 ns      10000

debuggee:
./bench/benchStyleContext.out --benchmark_repetitions=4 --benchmark_filter=Duk
total runtime:
0.544s
calls to allocation functions:
46542 (85555/s)
temporary allocations:
40159 (86.29%, 73821/s)
bytes allocated in total (ignoring deallocations):
2.84 MB (5.2 MB/s)

Duktape optimized

heaptrack ./bench/benchStyleContext.out --benchmark_repetitions=4 --benchmark_filter=Duk
DuktapeGetPropertyFixture/DuktapeGetPropertyBench/iterations:10000             11188 ns       5500 ns      10000
DuktapeGetPropertyFixture/DuktapeGetPropertyBench/iterations:10000              5718 ns       5476 ns      10000
DuktapeGetPropertyFixture/DuktapeGetPropertyBench/iterations:10000              5486 ns       5474 ns      10000
DuktapeGetPropertyFixture/DuktapeGetPropertyBench/iterations:10000              5434 ns       5423 ns      10000
DuktapeGetPropertyFixture/DuktapeGetPropertyBench/iterations:10000_mean         6957 ns       5468 ns      10000
DuktapeGetPropertyFixture/DuktapeGetPropertyBench/iterations:10000_median       5602 ns       5475 ns      10000
DuktapeGetPropertyFixture/DuktapeGetPropertyBench/iterations:10000_stddev       2824 ns         32 ns      10000

debuggee:
./bench/benchStyleContext.out --benchmark_repetitions=4 --benchmark_filter=Duk
total runtime: 
0.471s
calls to allocation functions:
46546 (98823/s)
temporary allocations:
40160 (86.28%, 85265/s)
bytes allocated in total (ignoring deallocations):
2.84 MB (6.0 MB/s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment