
Ask HN: How would you implement an (accurate) progress bar? - amelius
Progress bars in existing software are often &quot;broken&quot;. That is, by observing a progress bar, the user often cannot predict how long an operation will still take. Sometimes, the bar runs to 100% in a matter of seconds, after which processing continues for minutes or hours. In other cases, they hang at a low percentage, and then they suddenly skip to 100%. Similarly, &quot;ETA&quot; indicators are often broken too.<p>So, how would you implement a progress bar that Just Works (TM)?<p>Or is the problem so difficult to solve correctly, that it would require a Ph.D. project? In that case, the question is: why has nobody done theoretical work on the subject?
======
gus_massa
Somewhat related "Using Zeno's Paradox For Progress Bars" [the article is
dead, but this is the archived version]
[https://web.archive.org/web/20140224013525/http://www.atalas...](https://web.archive.org/web/20140224013525/http://www.atalasoft.com/cs/blogs/loufranco/archive/2006/12/01/11155.aspx)

More in:
[http://cerealnumber.livejournal.com/27537.html#/27537.html](http://cerealnumber.livejournal.com/27537.html#/27537.html)

------
PaulHoule
My favorite progress bar implementation is in Hadoop because Hadoop breaks
problems into small chunks that are (almost always) predictable so it can give
a good ETA even at a few percent level.

Something I've thought about (but not done) is making something that records
the log entries that a build process emits as it runs and then compares the
progress of the current run to the historical database.

------
viraptor
A progress bar for what? Some things are trivial (copying a local file with a
known size), some are impossible (streaming a file of an unknown size). It's
not the problem is a progress bar, it's a problem of:

\- How reliably can you provide the current stage mapped to the linear
progress (do you know what step you're on? Do you know how many store exist /
are enabled / are applicable?)

\- How reliably can you map each stage to the time required? Does it depend on
the environment / hardware / selected configuration?

For many cases the second one is basically unknown. You can still do a
combination of lists and progress bars per step, or something similar to make
it easier.

~~~
amelius
Valid questions!

Of course, we should assume that the information which the progress bar needs
is "knowable".

And perhaps the question needs better phrasing, because there will be a trade-
off between the resources used for computing the progress and it's accuracy.

