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
[RDF] Refactor progress bar and shorten its output.
This removes redundant information from the line printed to the
terminal and shortens the output. Otherwise, the progress bar
frequently overflows the terminal.
When the progress bar prints to a file, reduce the frequency to
every 10 seconds, and limit its width to 60 chars.
Furthermore, significantly improve how completion is estimated.
The following two heuristics are employed:
- Files that have been opened count as
fractionOfFilesAlreadyOpened * eventsProcessed/totalEvents
This tracks the progress of all files for which the number of events
has been seen.
- Files that have not been opened count as 1/totalFiles until they have
been opened. This means that the progress bar e.g. can't reach 50% if
half of the files haven't been opened yet.
This change significantly reduces the jumps of the progress bar when a
new file is opened.
Finally, significantly refactor the code:
- Handle locking logic for updates with a single RAII, update locks to C++17.
- Remove a lock and mutex that didn't have any effect.
- Reduce repeated function calls to functions that hold locks.
- Simplify computation of average number of events.
- Relax memory order of the atomics to what's necessary.
- Outline as many functions as possible. Since RDFHelpers.hxx goes
through JITting and pcms, it gets compiled frequently, so outlining is
probably beneficial.
- Make a lot of members const to avoid unintenional modifications. This
might be interesting because it's an MT context.
- Collect helper functions in one anonymous namespace.
- Remove a constructor argument that was ignored.
- Don't unconditionally clear cout at the end. The bar might be going to
a different stream.
0 commit comments