Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
After a bit of conversation with @joto, it looks like there are some easy speedups we can make with our Lua handling code to make
osrm-exract
run a lot faster.Don't make copies of
sol::function
objects for every call - this is simply unnecessary, and using thread-local cached copies gives us a 12-13% speedup very easily.Make calling the node_function optional. If the profile property
call_tagless_node_function
is set tofalse
, then thenode_function
won't get called if there are no tags on a node (you only need to call this in situations where you're doing coordinate lookups for nodes for some reason. The default profiles don't do this). Because there are more nodes than anything else, and most of them have no tags, this creates a speedup of 269 sec -> 135 seconds testingus-west-latest.osm.pbf
.This change should be backwards compatible. For those with old scripts that don't include the new
call_tagless_node_function
profile property, it will default to the old behaviour of calling thenode_function
for every node. Users can add this property to their existing scripts to gain access to the speedup.Tasklist