use parallel sorting when loading OSRM data files

This commit is contained in:
Dennis Luxen 2014-05-23 14:49:50 +02:00
parent d240ae3b03
commit 3fd8ab8d3a
2 changed files with 4 additions and 1 deletions

View File

@ -242,6 +242,7 @@ if(WITH_TOOLS)
find_package(GDAL)
if(GDAL_FOUND)
add_executable(osrm-components Tools/components.cpp)
target_link_libraries(osrm-components ${TBB_LIBRARIES})
include_directories(${GDAL_INCLUDE_DIR})
target_link_libraries(
osrm-components

View File

@ -41,6 +41,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <tbb/parallel_sort.h>
#include <cmath>
#include <algorithm>
@ -202,7 +204,7 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream,
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)
{
if ((edge_list[i - 1].target() == edge_list[i].target()) &&