Total run time:Edit #2: A couple charts are now fixed. Edit #1 below was written before fixing them.
Edit #1: Eagle-eyed observers may notice some oddities with FreeBSD in the last two charts.
The
combined subtotal of all the threaded tasks takes longer at 2 threads than 1 (thanks in no small part to graph generation's poor scaling).
Yet the total run time is faster at 2 threads than 1. How is this possible?
I picked the wrong timestamp to measure graph generation speed; I shouldn't be measuring just the subgraphs.
At 2+ threads, the master graph files are written alongside subgraphs --
numthreads-1
SubgraphThreads are spawned along with one
MasterTmgThread, which spawns another
SubgraphThread when it finishes. Meaning, when
numthreads = 1, no
SubgraphThreads are spawned until
MasterTmgThread finishes.
At 2+ threads, the master graphs are started at the same time as the
continent graphs, so my measurement will include time spent writing the master graphs too.
At 1 thread, the master graphs are finished before the continent graphs start. This makes our 1-thread figures look faster than they should compared to 2+ threads, as we're processing a smaller amount of data.
Writing the master graph files has to happen
somewhere -- where is it? It's after the "Setting up subgraphs" message is printed. Indeed if we use table.sh to measure the time spent on this "single-threaded" task, it's 15s @ 1 thread, and hovers around 0.02s from 2 to 24 threads. I think it's acceptable to include this time in our total graph generation figures.
So yeah, I'll run table.sh again with new timestamps, and fix the charts. Changes I expect to see:
- All 3 OSes will be shown taking longer writing graph files at 1 thread.
- The 2 Linux flavors will scale better between 1 & 2 threads.
- FreeBSD will scale... less badly. There will still be a time increase between 1 & 2 threads, just not as pronounced as currently shown.
- This bump will be enough for the 1->2-thread time savings in other tasks to offset the increase, and we should see an initial decrease in the threaded task subtotal on FreeBSD, in line with the the Total Run Time chart shows.