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
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 calling format! every iteration, I'm allocating a String 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
The text was updated successfully, but these errors were encountered:
JulianKnodt
changed the title
{msg}.set_message(Cow<'static, str>) is too restrictive{msg}.set_message(Cow<'static, str>) design unnecessarily requires allocation
Dec 20, 2023
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
The text was updated successfully, but these errors were encountered: