Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use google benchmarks and fix minor performance issues #91

Merged
merged 5 commits into from
Aug 11, 2020

Conversation

alexshalamov
Copy link
Contributor

@alexshalamov alexshalamov commented Aug 10, 2020

PR has following changes:

  • Rewrite benchmarks to use google benchmarks
  • Add few simple fixes (emplace, move, reserve)
  • Avoid expensive unordered_map copies and use shared_ptr internally while creating an index

Benchmarks (2.3 GHz 8-Core Intel Core i9, macbook pro)

Comparing ./build/bench_head to ./build/bench
Benchmark                                                           Time             CPU      Time Old      Time New       CPU Old       CPU New
------------------------------------------------------------------------------------------------------------------------------------------------
ParseGeoJSON                                                     +0.0017         +0.0018          2272          2275          2271          2275
GenerateTileIndex                                                -0.2651         -0.2649         11567          8501         11558          8496
TraverseTilePyramid/iterations:3                                 -0.1701         -0.1700          1332          1106          1331          1105
LargeGeoJSONParse                                                -0.0043         -0.0048         28292         28171         28291         28157
LargeGeoJSONTileIndex                                            -0.4434         -0.4438         26996         15026         26983         15007
LargeGeoJSONGetTile/iterations:1/repeats:9_mean                  -0.7254         -0.7254           207            57           206            57
LargeGeoJSONGetTile/iterations:1/repeats:9_median                -0.7210         -0.7211           205            57           205            57
LargeGeoJSONGetTile/iterations:1/repeats:9_stddev                -0.4379         -0.4380             6             4             6             4
LargeGeoJSONToTile                                               +0.0218         +0.0236          1202          1228          1200          1228
SingleTileIndex                                                  +0.0532         +0.0533             0             0             0             0
SingleTileGeoJSONToTile                                          -0.0675         -0.0675            12            12            12            12

// Single run with units, compare.py removes unit types
-----------------------------------------------------------------------------------------
Benchmark                                                  Time           CPU Iterations
-----------------------------------------------------------------------------------------
ParseGeoJSON                                            2275 us       2275 us        308
GenerateTileIndex                                       8501 us       8496 us         75
TraverseTilePyramid/iterations:3                        1106 ms       1105 ms          3
LargeGeoJSONParse                                      28171 us      28157 us         24
LargeGeoJSONTileIndex                                  15026 us      15007 us         49
LargeGeoJSONGetTile/iterations:1/repeats:9_mean           57 ms         57 ms          1
LargeGeoJSONGetTile/iterations:1/repeats:9_median         57 ms         57 ms          1
LargeGeoJSONGetTile/iterations:1/repeats:9_stddev          4 ms          4 ms          1
LargeGeoJSONToTile                                      1228 us       1228 us        565
SingleTileIndex                                            0 us          0 us   65396725
SingleTileGeoJSONToTile                                   12 us         12 us      61809

@alexshalamov alexshalamov changed the title Alexshalamov add benchmarks Use google benchmarks and fix minor performance issues Aug 10, 2020
@alexshalamov alexshalamov marked this pull request as ready for review August 11, 2020 11:04
include/mapbox/geojsonvt/clip.hpp Outdated Show resolved Hide resolved
@alexshalamov alexshalamov merged commit 1c0e989 into master Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants