You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
waypoints: The the same approach as for the routes & connectedRoutes tables, and nix std::string Waypoint::csv_line in favor of inserting the info directly into the ofstream.
clinched_list setup: just construct std::pair<TravelerList*,unsigned int>s
clinched has nothing much to do other than adapt to the new clinched_list set up while processing segments. Will probably run a wee bit slower than just inserting already-constructed strings as we do now, but that should be outweighed by the improvement to segments.
Python:
Odd that in C++, segments took 1.7x as long as waypoints but here it takes half as long. Whatever, I'll blame the mysteries that go on behind the curtain, like string interning or whatever.
waypoints
Including the parens & newline in Waypoint.csv_line may help, avoiding constructing one string and then another string based off of it.
Would eliminating Waypoint.csv_line altogether help? AIUI, a string object is still constructed for the file object to write. As a temporary value, is it interned?
segments
Follow the lead of waypoints with parens, newlines, and the csv_line function.
Not much to do with clinched_list, as that has to be stringified before writing anyway. Except:
clinched can lose the parens & newlines, with those constructed directly in clinched_list earlier. Mirror image of the C++ diffs -- slower in segments, made up for by being faster here.
The text was updated successfully, but these errors were encountered:
Ideas for speeding up the highest-impact DB tables
C++:
Python:
waypoints
: The the same approach as for theroutes
&connectedRoutes
tables, and nixstd::string Waypoint::csv_line
in favor of inserting the info directly into the ofstream.segments
has 2 components to improve:std::string HighwaySegment::csv_line
clinched_list
setup: just constructstd::pair<TravelerList*,unsigned int>
sclinched
has nothing much to do other than adapt to the newclinched_list
set up while processingsegments
. Will probably run a wee bit slower than just inserting already-constructed strings as we do now, but that should be outweighed by the improvement tosegments
.segments
took 1.7x as long aswaypoints
but here it takes half as long. Whatever, I'll blame the mysteries that go on behind the curtain, like string interning or whatever.waypoints
Waypoint.csv_line
may help, avoiding constructing one string and then another string based off of it.Waypoint.csv_line
altogether help? AIUI, a string object is still constructed for the file object to write. As a temporary value, is it interned?segments
waypoints
with parens, newlines, and thecsv_line
function.clinched_list
, as that has to be stringified before writing anyway. Except:clinched
can lose the parens & newlines, with those constructed directly inclinched_list
earlier. Mirror image of the C++ diffs -- slower insegments
, made up for by being faster here.The text was updated successfully, but these errors were encountered: