27 Aug
2012
27 Aug
'12
9:06 a.m.
Hello, I use boost::graph and the Dijkstra algorithm. My edge property is rather big (I store public transport timetables on them). In the file boost/graph/relax.hpp, the property of an edge is copied : W w_e = get(w, e); As my properties are large, it yields some overhead. I changed that line to const W & w_e = get(w, e); My benchmarks (on 1000 runs) went from 101 secs down to 87 (using GCC 4.6 -O3) So my question is : – would it hurt if it used const& instead of copy? – am I not correctly using the lib? Maybe should I use an index on the edge property and use a functor to get the data in the different operations (edge_less, combine); but wouldn't it mean re-implementing the properties? Thank you for your help