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

Speed up OSMData -> MapData #57

Merged
merged 1 commit into from
Nov 3, 2021
Merged

Conversation

blegat
Copy link
Contributor

@blegat blegat commented Nov 2, 2021

Adding a @time at this line:

res = MapData(mapdata, road_levels, only_intersections; trim_to_connected_graph=trim_to_connected_graph)

Before this PR, I get:

julia> get_map_data("/home/blegat/Downloads/andorra-latest.osm", use_cache=false);
  0.097901 seconds (222.99 k allocations: 50.380 MiB)

julia> get_map_data("/home/blegat/Downloads/andorra-latest.osm", use_cache=false);
  0.086140 seconds (222.99 k allocations: 50.380 MiB)

julia> get_map_data("/home/blegat/Downloads/andorra-latest.osm", use_cache=false);
  0.150200 seconds (222.99 k allocations: 50.380 MiB, 40.81% gc time)

julia> get_map_data("/home/blegat/Downloads/andorra-latest.osm", use_cache=false);
  0.090045 seconds (222.99 k allocations: 50.380 MiB)

After this PR, I get

julia> get_map_data("/home/blegat/Downloads/andorra-latest.osm", use_cache=false);
  0.026511 seconds (29.02 k allocations: 8.461 MiB)

julia> get_map_data("/home/blegat/Downloads/andorra-latest.osm", use_cache=false);
  0.027412 seconds (29.02 k allocations: 8.461 MiB)

julia> get_map_data("/home/blegat/Downloads/andorra-latest.osm", use_cache=false);
  0.027245 seconds (29.02 k allocations: 8.461 MiB)

Copy link
Owner

@pszufe pszufe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow! this looks impressive in terms of performance.
Perhaps here and there still is space for improvement by changing Strings to Symbols but this is a minor difference compared to this change

@pszufe pszufe merged commit d486bc1 into pszufe:master Nov 3, 2021
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.

2 participants