Open JulianKnodt opened 10 months ago
So are you updating the message on every iteration of a hot loop? Maybe it's feasible to use a ProgressTracker impl instead?
Right now I'm displaying [Elapsed/ETA] {progress bar} {current iter}/{total iters}{msg}
. I now only update the msg every Nth iteration, which is alright.
I don't see a ton of docs for the progress tracker (I didn't even know it existed). If I want to use that, do I have to drop a lot of existing functionality?
Uh, no? The ProgressTracker
can be used to define a custom key for use in a format string, so you can do whatever you need with your float and only have it format whenever indicatif is drawing.
Currently I want to display a float adjacent to the progress bar (for reference it's essentially an optimization loss).
Right now, I have to do
{msg}
in the style, and later.set_message(format!("{:.03e}", float))
. It's a hyper optimization, but because I'm callingformat!
every iteration, I'm allocating aString
every loop. Is it possible to have a function that instead takes an Arguments struct, thus (I think) removing the allocation?Willing to figure out how to submit a PR if so