-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{fmt}: #585 phase 1 take 2 #628
Conversation
Nix performance-killing: * sprintf * try/catch blocks Enable multi-threading by default
userlogsHere are links to charts of how the last three performance improvements played out.
This finally brings FreeBSD's time under control across the board, even outperforming both Linux flavors on the same hardware. |
databaseTable speed was measured using siteupdateST. routes
These patterns will more or less hold with the rest of the tables too. connectedRoutes waypoints overallMileageByRegion systemMileageByRegion clinchedOverallMileageByRegion clinchedSystemMileageByRegion clinchedConnectedRoutes clinchedRoutes entire .sql file |
graph generationAgain, note that the .sql file is written in the background during graph generation.
Zoomed in. Writing to /dev/null (25 & 30), we see the big performance gap between Linux & FreeBSD disappear, with bsdlab even outperforming lab3 (CentOS7) and lab4 (Ubuntu 18.04) on the same hardware. |
alternate universeWith the merge commit in the history, 69545d1 can show us... What if
|
That does it for redoing #623. routedatastats.log
This task takes longer with threaded siteupdate than siteupdateST, even though it only uses a single thread in either case. The code is the same in both versions. |
stats CSVsStats CSVs have a few extra factors at play, and deserve a slightly different look. Before, This led to allbyregionactivepreview.csv alone taking longer than all per-system CSVs combined.
At 2+ threads, the allbyregion* ones called Due to a bug in a benchmarking script, I thought all but the fastest machines performed worse multithreaded (only lab3 & 4 did), so I made multi-threaded CSVs a commandline option, with single-threaded the default behavior. Now, With this in mind, it makes sense to use >3 threads now, so that restriction has been lifted. Multi-threaded
What's lab2 doing? Cherrypick the nicest-looking line, plop it into the previous chart, and it still lags behind the other machines. Edit: |
Ready to rock, |
I can compile and run on my Mac, but I had to change the
|
Full production site update in 24.1 seconds. Was 112.0 yesterday. Nice! |
...with graph generation at 11.9 s. Not bad! Edited #628 (comment) to add a logarithmic chart of all machines, before & after. Meant to do that earlier. Deleted branches on BiggaTomato:
|
Does this now mean I can b-slap you now @yakra till you do the new AR US-78 file? :P Just had to say it for fun. :) |
That's certainly been on my mind as work on this dragged out. That'll be my no.1 priority on getting back to the forum; I know that's a big one. Oy vey. I have so many browser tabs open. Firefox & Chromium here on the desktop, more Firefox on the laptop... |
@rickmastfan67 I know you posted somewhere here on GitHub about US78. And I was like, "Noted." Edit: Found it. |
Must feel like 3000 years ago, eh @yakra? LOL! |
Closes #626.
This reverts & re-does #623.
The slowdown is gone, replaced with the speedup it really should have been.
Like before,
sprintf
has been removed from user log, DB file, and graph generation routines.(And now, routedatastats.log & stats CSVs too.)
This time, it's been replaced with calls to the {fmt} library instead of using iostreams for
double
formatting.As with #622, I recommend downloading and doing a compile & test drive before merging:
--errorcheck
now? 😁As noted before, we're nearing the end of the road for big graph generation improvements.
Percentagewise, this is in line with the first big five pull requests from 2019.
It's about middle-of-the-pack, doesn't beat all of them hands-down. (#623 did, but only in the unrealistic scenario of writing to invalid files, e.g. /dev/null.)
While I still have a few ideas left, there probably won't be anything else of this magnitude. Just smaller incremental changes, much lower impact.
Although, now that we know formatting numbers is a hotspot, we can add a couple more items to that list:
fmt::format_int
and {fmt}'sstd::ofstream
support.FreeBSD seems especially hampered by formatting numbers (at least, with
double
s); this may help.