use parallel sorting when loading OSRM data files
This commit is contained in:
parent
d240ae3b03
commit
3fd8ab8d3a
@ -242,6 +242,7 @@ if(WITH_TOOLS)
|
|||||||
find_package(GDAL)
|
find_package(GDAL)
|
||||||
if(GDAL_FOUND)
|
if(GDAL_FOUND)
|
||||||
add_executable(osrm-components Tools/components.cpp)
|
add_executable(osrm-components Tools/components.cpp)
|
||||||
|
target_link_libraries(osrm-components ${TBB_LIBRARIES})
|
||||||
include_directories(${GDAL_INCLUDE_DIR})
|
include_directories(${GDAL_INCLUDE_DIR})
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
osrm-components
|
osrm-components
|
||||||
|
@ -41,6 +41,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
#include <boost/filesystem/fstream.hpp>
|
#include <boost/filesystem/fstream.hpp>
|
||||||
|
|
||||||
|
#include <tbb/parallel_sort.h>
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -202,7 +204,7 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream,
|
|||||||
is_split);
|
is_split);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::sort(edge_list.begin(), edge_list.end());
|
tbb::parallel_sort(edge_list.begin(), edge_list.end());
|
||||||
for (unsigned i = 1; i < edge_list.size(); ++i)
|
for (unsigned i = 1; i < edge_list.size(); ++i)
|
||||||
{
|
{
|
||||||
if ((edge_list[i - 1].target() == edge_list[i].target()) &&
|
if ((edge_list[i - 1].target() == edge_list[i].target()) &&
|
||||||
|
Loading…
Reference in New Issue
Block a user