diff --git a/CHANGELOG.md b/CHANGELOG.md index 6276ced9758..e20c45cbeb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - FIXED: Use Boost.Beast to parse HTTP request. [#6294](https://github.com/Project-OSRM/osrm-backend/pull/6294) - FIXED: Fix inefficient osrm-routed connection handling [#6113](https://github.com/Project-OSRM/osrm-backend/pull/6113) - Misc: + - FIXED: Fix performance issue after migration to sol2 3.3.0. [#6304](https://github.com/Project-OSRM/osrm-backend/pull/6304) - CHANGED: Pass osm_node_ids by reference in osrm::updater::Updater class. [#6298](https://github.com/Project-OSRM/osrm-backend/pull/6298) - FIXED: Fix bug with reading Set values from Lua scripts. [#6285](https://github.com/Project-OSRM/osrm-backend/pull/6285) - FIXED: Bug in bicycle profile that caused exceptions if there is a highway=bicycle in the data. [#6296](https://github.com/Project-OSRM/osrm-backend/pull/6296) diff --git a/include/extractor/extraction_relation.hpp b/include/extractor/extraction_relation.hpp index 033aea8a1d2..6c4203b75b4 100644 --- a/include/extractor/extraction_relation.hpp +++ b/include/extractor/extraction_relation.hpp @@ -93,6 +93,10 @@ class ExtractionRelationContainer using RelationIDList = std::vector; using RelationRefMap = std::unordered_map; + ExtractionRelationContainer() = default; + ExtractionRelationContainer(ExtractionRelationContainer &&) = default; + ExtractionRelationContainer(const ExtractionRelationContainer &) = delete; + void AddRelation(ExtractionRelation &&rel) { rel.Prepare(); diff --git a/src/extractor/scripting_environment_lua.cpp b/src/extractor/scripting_environment_lua.cpp index 8e92ee5345d..2d0978d51f3 100644 --- a/src/extractor/scripting_environment_lua.cpp +++ b/src/extractor/scripting_environment_lua.cpp @@ -1093,7 +1093,7 @@ void Sol2ScriptingEnvironment::ProcessTurn(ExtractionTurn &turn) case 2: if (context.has_turn_penalty_function) { - context.turn_function(context.profile_table, turn); + context.turn_function(context.profile_table, std::ref(turn)); // Turn weight falls back to the duration value in deciseconds // or uses the extracted unit-less weight value @@ -1108,7 +1108,7 @@ void Sol2ScriptingEnvironment::ProcessTurn(ExtractionTurn &turn) case 1: if (context.has_turn_penalty_function) { - context.turn_function(turn); + context.turn_function(std::ref(turn)); // Turn weight falls back to the duration value in deciseconds // or uses the extracted unit-less weight value @@ -1159,14 +1159,16 @@ void Sol2ScriptingEnvironment::ProcessSegment(ExtractionSegment &segment) case 4: case 3: case 2: - context.segment_function(context.profile_table, segment); + context.segment_function(context.profile_table, std::ref(segment)); break; case 1: - context.segment_function(segment); + context.segment_function(std::ref(segment)); break; case 0: - context.segment_function( - segment.source, segment.target, segment.distance, segment.duration); + context.segment_function(std::ref(segment.source), + std::ref(segment.target), + segment.distance, + segment.duration); segment.weight = segment.duration; // back-compatibility fallback to duration break; } @@ -1183,14 +1185,14 @@ void LuaScriptingContext::ProcessNode(const osmium::Node &node, { case 4: case 3: - node_function(profile_table, std::cref(node), result, relations); + node_function(profile_table, std::cref(node), std::ref(result), std::cref(relations)); break; case 2: - node_function(profile_table, std::cref(node), result); + node_function(profile_table, std::cref(node), std::ref(result)); break; case 1: case 0: - node_function(std::cref(node), result); + node_function(std::cref(node), std::ref(result)); break; } }