Slashdot Mirror


Ask Slashdot: Why Is It So Hard To Make An Accurate Progress Bar?

hyperorbiter writes "How come after 25 years in the tech industry, someone hasn't worked out how to make accurate progress bars? This migration I'm doing has sat on 'less than a minute' for over 30 minutes. I'm not an engineer; is it really that hard?"

94 of 736 comments (clear)

  1. it's because by Anonymous Coward · · Score: 5, Funny

    Comment loading ...

    1. Re:it's because by dalias · · Score: 2

      If your installer is taking so long that the progress bar would be visible on the screen for more than 5 or 6 refresh cycles, you're doing something wrong and you should just give up.

  2. Uhmmm. by Fellon · · Score: 5, Insightful

    Yes it is "that hard".

    --
    I did it all for the penguins!
    1. Re:Uhmmm. by mjr167 · · Score: 2

      Wait... you mean to say that you can't predict the future?

  3. Yes. by kc9jud · · Score: 5, Funny

    Yes it is. And to be fair, it's a lot more accurate than Nostradamus ever was.

    1. Re:Yes. by Pieroxy · · Score: 2

      Yes it is. And to be fair, it's a lot more accurate than Nostradamus will ever be.

      There, FTFY.

  4. because by ILongForDarkness · · Score: 5, Insightful

    Things are asyncronous. You wait for things from disk, ram, user input, over the network etc. How long it will take is non-deterministic. So a task composed of a bunch of these little pieces will be non-deterministic too.

    1. Re:because by eksith · · Score: 4, Insightful

      This. Also, there may be other applications/processes that may start up, suddenly demand resources or jump in priority, which inevitably result in a progress bar going backwards.

      --
      If computers were people, I'd be a misanthrope.
    2. Re:because by geekmux · · Score: 5, Interesting

      Things are asyncronous. You wait for things from disk, ram, user input, over the network etc. How long it will take is non-deterministic. So a task composed of a bunch of these little pieces will be non-deterministic too.

      If this is true (which it is), then logic would dictate that it is pointless to represent a progress bar in measurements of time.

      Perhaps the larger question is how much longer are we going to continue acting stupid about it, rather than trying to make a clock out of it.

    3. Re:because by marnues · · Score: 2

      As long as people want to know how much longer it takes. We operate in time. This is why progress bars are so prevalent even though they aren't accurate.

    4. Re:because by NotQuiteReal · · Score: 5, Insightful

      Plus, you are lucky even get a "guesstimate bar". Showing progress with bad estimates is more reassuring than just a "working on it spinner". Either is an order of magnitude better than an unresponsive GUI because the programmer didn't put that stuff in another thread.

      Personally, I like the "list of what I am going to do + check them off as they are done" approach, if the "progressing task" is of varying descriptions.

      That said, for some tasks, you have to consider the "Heisenberg effect" a bit, depending on the work being done - do you want your progress bar pestering the "worker" for progress reports all the time, or just doing its job.

      --
      This issue is a bit more complicated than you think.
    5. Re:because by ILongForDarkness · · Score: 2

      Well we do this in the real world too though say asking the mechanic when you can get your car back. Just asking wastes resources and means the answer is "later than it would have been before you interrupted". But even with a rough estimate is usually pretty good (except when it isn't and then it really isn't like installing apps and seeing 10min go to 2hrs) and can adapt to changing data. I think the problem is expectations: we want exact answers which is understandable if you are waiting for something (I work with radiation simulation software you can be waiting for 20min for a result if you knew exactly when you could leave instead you watch the progress bar) but exact answers are not inherent in either the hardware or the problem space that we are working.

    6. Re:because by ILongForDarkness · · Score: 5, Insightful

      The list/status bar solution is nice for another reason: if your program does hang your users know where in the process it happened. You get more useful feedback from the users, sometimes they might be able to troubleshoot it themselves (oh it is dying when connecting to my fileserver, perhaps I"m not connected to the network). Heck it is useful for course grained optimization you see the logical steps that take the most time and can drill down into speeding them up as much as possible.

    7. Re:because by drkim · · Score: 2

      ...I would welcome the demise of the progress bar if it were replaced with an activity animation along with Andy Rooney quotes.

      Or even some Andy Rooney animation:

      "You ever wonder why they call it a 'computer?' We don't really do any computing with it. Maybe they should call it a 'time-wastey box'..."

  5. Various reasons by GoodNewsJimDotCom · · Score: 5, Insightful

    One reason is the progress bar starts out as just a generic tool to show that your loading hasn't froze. At first it is parsed correctly with the elements to be loaded, but as scope increases and more things load, it can get sketchy later on.

    Another reason is it is difficult to estimate time left. If you look at some old FTP programs, they'd estimate the rest of the download's time based on how fast the previous has taken. Future lag, fragmented files, etc aren't taken into consideration.

    There's a bunch more reasons, but namely the progress bar's main purpose is to show you that the whole system isn't locked up, which they've been doing well for the past 30 years or so.

    1. Re:Various reasons by ILongForDarkness · · Score: 2

      This is why if it is something the user will understand I like to use a status bar instead. Much nicer to see things moving through a workflow than trying to guess how long the db load vs analysis will take and display the progress bar correctly which will change as the data grows, complexity of the problem, computer the user is on etc. Progress not timing, we should just completely remove the complete from the visual just have a numerical counter, if it is increasing things are still working.

    2. Re:Various reasons by uncqual · · Score: 5, Insightful

      And a spinning asterisk or swirlie does that fine, without implying anything about "progress" or "time left".

      The spinning asterisk or swirlie just tells you that the thread updating the asterisk or swirlie hasn't frozen -- it often doesn't tell you anything about the underlying activity the user is waiting for.

      --
      Why is there an "insightful" mod and why isn't it "-1"? If I wanted insight, I wouldn't be reading /.
    3. Re:Various reasons by shutdown+-p+now · · Score: 2

      We're not talking about a "time left" bar, we're talking about a progress bar (although if things continue at a constant rate, the two should be the same). While there are exceptions, mostly the program should have a decent estimate of the total amount of work to be completed.

      What is the measurement unit for "amount of work", though?

      Take file copying for a canonical example. The most reasonable unit of measurement in that case would be the number of bytes copied. However, to properly compute relative progress for that, you need to find out the total size of all files before starting the copy. For a large tree, computing that can itself take a fair bit of time (remember the copy dialogs in Vista, which could sit there for a minute before even starting to copy?). It can be even more expensive if part of the tree is not on a local FS, but is accessed over the network - think NFS or Samba mount point.

      But say you do it and start copying. You can still run into interesting corner cases - e.g. what happens if the size of some file changes on the disk after you computed it originally, but before you got a chance to copy it? And even if nothing changes, the speed difference between copying a local file and a remote one can be so great that you end up with that same dreaded situation where your progress bar gets to 50% in a minute, and then takes ten more minutes to finish at 100% - and the user is going to be annoyed regardless.

    4. Re:Various reasons by number11 · · Score: 2

      Say you are copying files from a network drive to local, and you get 90% of the file(s) done in an hour. Then, the network usage spikes, so your bandwidth drops to 1% of what it was. A progress bar would show 90%, even though you are going to get that last It should take, if my brain is working right, just over another hour to copy the remaining file(s). So, what do you want the progress bar to show? 90% because only 10% of the bits are left? 50% because that's the time estimate? Maybe 2 of 3 files were copied already and the remaining file is huge, so should the progress bar show 66% to show that 2/3rds are done?

      You've got 90% done, so you're at 90% progress. I'm arguing that progress bars should not be "time to completion", for that reason, that you can't easily predict those variables.

      OTOH, my bittorrent client uses bytes still needed at the current speed to predict time to completion, that works too, but that technique may not generalize well to other tasks. To me, time to completion should be a number, not a bar. To have a bar, you need to know what the maximum is. Hell, show both % complete and time to completion if you want, but it may not be worth the work, mostly the user just wants to see that progress is being made.

      In your example, I'd want to see a bar showing the percentage of total bytes done. Some posts here are arguing that it may not be practical to know total bits ahead of time. Well, yeah, but that's not true of most situations. If you can't (easily) know the total number of bytes, then use number of files. If you can't easily know that, then number of modules, folders, or whatever larger unit you can easily predict. No progress bar is going to be perfect, and that's ok, "best guess" is ok. The principal purpose is to a) show the user that the program hasn't died, and b) to allow the user to make some sort of estimate, however rough, about time to completion.

    5. Re:Various reasons by fnj · · Score: 2

      The turning propeller or cylon helmet light going back and forth (or the papers flying if you must) should work like a watchdog. If the worker thread/process gets hung, the displayed element should freeze. If all it tells you is that some propeller updater thread is still running in isolation, then the system is not competently designed.

    6. Re:Various reasons by petermgreen · · Score: 2

      Sure it should.

      The thing is a progress bar is pretty hard to fake convincingly, if your bar always progresses at the same rate and then freezes at a fixed point it's going to get noticed pretty quick. A spinner or similar indicator is much easier to fake convincingly and if something is easy to fake convincingly there will always be the suspicion that it is fake..

      Heck windows kinda institutionalised faking such things by including animated icon support in the OS itself and including an icon set where the hourglass was animated.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  6. sometimes by MrDoh! · · Score: 3, Informative

    Copying files. Sure, get a list of the files to be moved, get the size, as files go across, start the % progress meter. What if the network starts slowing down as you start to copy? New files are added. You used a rough calc to get a vague idea as it was 10x faster, but when you start copying, there's a lot of files bigger than you thought. Network's fast, but the end machine you're copying too is having problems keeping up. You start hitting cache, it was fast (and skewed the result) till then, now it's crawling. Installations. All the fun of copying files, but you're updating existing files too, file system may be fragmented, some of the .ini files as you get to may need extra work. Drivers to install may take longer than expected. Once installed, you have to generate/compile/download extra, that's more rough guesses. As long as the hourglass/cursor/spinner is spinning, and the %'s is going up now and then, probably the best you can ask for. The trend for guesstimating time remaining seems to be diminishing, as surely the main thing most people want is to know 'is this still working or has it hung?' for anything else, logcat/catch stderr'more details' to find out what it's actually doing. It COULD be more accurate perhaps, but you'd spend so long working it all out in advance, for 9/10 things, it'd have been quicker to just do it.

    --
    Waiting for an amusing sig.
    1. Re:sometimes by PlusFiveTroll · · Score: 5, Informative

      The Windows8/Server 2012 dialog is much better in this case.

      http://encosia.com/blog/wp-content/uploads/2012/09/windows-8-file-copy-dialog.png

      It draws a graph showing you the current rate, in which you can see the average over time.

  7. Yes by Austerity+Empowers · · Score: 3, Insightful

    It's very hard to predict how long something will take, particularly in relation to other things, if what you're writing is going to be on any number of platforms with different processors, storage, memory and network situations.

    You can be reasonably accurate with it, far more than my favorite 99% in 1 second, the last 1% in one hour scenario. There are cleverer and cleverer ways of making it ever more precise, but those methods usually involve spending time on getting it right, and not many people do it.

    1. Re:Yes by greg1104 · · Score: 4, Interesting

      I would have stopped at "yes" without the optimism, and it's not even a platform/processor issue. This is a fundamentally unsolvable thing, since in some cases it reduces to the halting problem. That best you can do is come up with an approximation.

      But the approximations will be wrong too. Simple example: write speed. If you write a block to disk, and it fits into the operating system cache, a write happens almost instantly. If the cache is full, you might have to spend tens of seconds waiting before that write occurs. Here's what happens with installers, copy programs, and a large chunk of other things. You write until the cache fills, and those happen at memory speeds. Then, all of the sudden, you grind to a halt when the cache fills. You won't see any progress, sometimes for minutes--it can take a while to chug through gigabytes of random writes. I show an example of this on my blog on Linux, and this problem gets worse as memory increases, not better.

      What does that look like to the user? They get a progress bar, it zooms along for a while, and then it cranks to a halt. Then it hangs for a bit, starts moving, and the whole thing completely changes scale. Does this sound familiar? That's what people complain about, right? You can't make that go away without building a model of the caching mechanism that's more accurate than the cache itself. After all, if you could predict this was coming, the OS could have done a better job scheduling I/O with that information, too. Think about that for a minute: to write a really good progress bar for write operations, you have to do a better job on I/O scheduling than Linux does.

      If you step back and say "well let's approximate how long disk I/O takes then and base the bar on that", you'll discover that doesn't work either. There's over a 100:1 difference between the fastest and slowest storage on the market. Good luck modeling that accurately enough to predict the future, too.

  8. It's probably patented by Punto · · Score: 3, Funny

    There's probably a pantent for a "method or apparatus for an accurate display of progress", nobody wants to mess with that (but seriously most of my innacurate progress bars deal with unpredictable things like I/O, or non-uniform sets like loading textures and meshes and animations all together, so who knows how much time it will actually take to process the same ammount of data?)

    --

    --
    Stay tuned for some shock and awe coming right up after this messages!

  9. Re:no, it's easy. by dotHectate · · Score: 5, Funny

    You know someone is going to take your suggestion literally as a tutorial on how to implement a progress bar - later they'll come back with some mystical crash always happening at 0%.

    --
    Patience is a virtue, but haste is my life.
  10. It's mathematically impossible. by PseudoThink · · Score: 4, Informative

    See http://scribblethink.org/Work/kcsest.pdf and http://scribblethink.org/Work/Softestim/softestim.html

    (No, I'm not being serious. The topic just reminded me of when I once jokingly justified a poorly estimated ETA on a "simple" development project by referencing the above paper.)

  11. MSIE by Anonymous Coward · · Score: 5, Interesting

    My favorite terrible progress bar was Internet Explorer, back in its early days of essentially being a renamed version of NCSA Mosaic. When attempting to load a site that wasn't available, the progress bar would slowly creep towards complete, despite the server being completely unresponsive. Then after a long while the browser would give up and stop the progress bar. Why on earth would the progress bar move if the server is completely unresponsive? Who programmed this? I would hope that they, like the inventor of Clippy, suffered a terrible death by fire.

    1. Re:MSIE by blueg3 · · Score: 2

      Are you kidding? Lots of processes still use that damn indefinite progress bar. I think a recent version of IE might, even. As time progresses, even if no real progress is made, it fills up some small fraction of the remaining space. The next block of no-progress "time" uses up the same small fraction of the *now-remaining* space, so the progress bar creeps forever toward the end, even though no progress is made.

  12. Can't Go Backwards by naroom · · Score: 5, Insightful

    Consider this: Once you've put progress on a bar, you can't take it off. Suppose you start a process that should take 20 minutes, and do the first 5 minutes, progress is now at 25%. But then, partway through, something unexpected happens and you realize the process is actually going to take 40 minutes. You can't take the progress "back" now, that would disorient the user. So you have to rescale the remainder of the bar.

    1. Re:Can't Go Backwards by Jafafa+Hots · · Score: 4, Insightful

      I've seen some progress bars that do exactly that - go backwards.

      --
      This space available.
    2. Re:Can't Go Backwards by citizenr · · Score: 5, Informative

      This is why you put two progress bars. One general and one for sub processes.
      http://www.codeproject.com/KB/progress/SplitProgressBar/SplitProgressBar.gif

      --
      Who logs in to gdm? Not I, said the duck.
    3. Re:Can't Go Backwards by UltraZelda64 · · Score: 2

      Yes and it's those--as well as those that dance left and right for no damn reason--that really piss me off.

    4. Re:Can't Go Backwards by shutdown+-p+now · · Score: 4, Interesting

      I've seen progress bars that go backwards, but it usually indicates reversal of something that is done previously. E.g. in MS Office installer, if you cancel the installation midway through, it will "rewind" the progress bar while cleaning up.

    5. Re:Can't Go Backwards by Agent+ME · · Score: 5, Insightful

      What? Why the fuck would a progress bar go backwards? A progress bar shouldn't be pegged to the fraction of time of the job done. It should be pegged to the actual progress. If progress starts going slower, then the progress bar should start moving slower.

    6. Re:Can't Go Backwards by The+Snowman · · Score: 5, Funny

      Yes and it's those--as well as those that dance left and right for no damn reason--that really piss me off.

      You mean like this one? http://xkcd.com/612/.

      --
      24 beers in a case, 24 hours in a day. Coincidence? I think not!
    7. Re: Can't Go Backwards by LesFerg · · Score: 5, Insightful

      Realistically a large IO bound task is something you hand off to low-end process to get it done as fast as ppssible. Would you over-ride the O/S to transfer that 10gigs in 100 meg blocks and report each bit back to your high level UI so that th progress bar is accurate?

      --
      If I had a DeLorean... I would probably only drive it from time to time.
    8. Re:Can't Go Backwards by _Shad0w_ · · Score: 2

      Last time I did that at work I got told to reduce it back to one.

      --

      Yeah, I had a sig once; I got bored of it.

    9. Re: Can't Go Backwards by Yaur · · Score: 3, Informative

      Yes. You aren't doing the IO on the UI thread and posting a message to update the UI, even once per second, will slow down the transfer by an insignificant amount of time and improve the UX dramatically.

    10. Re: Can't Go Backwards by smellotron · · Score: 2

      Would you over-ride the O/S to transfer that 10gigs in 100 meg blocks and report each bit back to your high level UI so that th progress bar is accurate?

      If the transfer is going to take more than a few hundred milliseconds, yes. The extra latency due to such "interruptbs" is small enough to justify the improvement in responsiveness.

    11. Re:Can't Go Backwards by asliarun · · Score: 5, Insightful

      To put it another way, it is impossible to make an accurate progress bar because it is impossible to predict the future. That's all.

      You can make assumptions, extrapolation, use past performance,etc but you are never going to get it accurate.

      This is like getting pissed at your GPS because it told you you will reach in 22 mins when it actually took you 35.

      It is either a dumbass expectation from the user or a dumbass design decision. You might have as well used an hourglass so the user could spend their time shaking it trying to get the sand to fall faster.

    12. Re:Can't Go Backwards by ibennetch · · Score: 5, Funny

      I think I prefer going backwards to what I once saw on (what I remember as) a Microsoft Office installation, probably 15 years ago. The progress bar ever so slowly crept upwards...98, 99, 100% done...then 101, and so on. It finally locked up somewhere after 140%.

    13. Re: Can't Go Backwards by Impy+the+Impiuos+Imp · · Score: 5, Interesting

      We used an industrial strength version of cp in one product, which used DMA for much faster copy, and would write out status every 20 Mb that it could resume from in power loss, and would also, via shared memory variable, publish progress in bytes, all so you could have an accurate progress indicator.

      Some people do know what they are doing.

      --
      (-1: Post disagrees with my already-settled worldview) is not a valid mod option.
    14. Re:Can't Go Backwards by Arancaytar · · Score: 4, Insightful

      Yeah, but then users complain because the bar is weirdly scaled, like 95% taking up a second and the remaining 5% an hour. You can try to profile it, but the actual time is determined by the local hardware after all: Processor speed, number of cores (which affects only some operations), network speed, free memory - there's no way to predict how much of the time will be spend on each task.

      (And if the progress bar isn't an indicator of execution time at all, then the arbitrary completion percentages assigned by the developer mean little. In that case, you may as well go back to hourglasses and spinning beachballs...)

    15. Re:Can't Go Backwards by JonJ · · Score: 4, Funny
      --
      -- Linux user #369862
    16. Re:Can't Go Backwards by fnj · · Score: 5, Insightful

      Suppose a bar can never back up. Then its speed may vary enormously, making the visual how-done-am-I representation valueless.

      It is HARD.

      Define "fraction of job time done" numerically. Suppose you have to download 100 packages and then install them. How many % of the total should the download represent? Does the guy have cable or dialup? And how many % does the install represent? Does he have a slow USB hard drive or a ridiculously fast SSD? What if the first file downloads at 1 MBps and the 17th one at 139 Bps? I've seen that happen (varying server load, per-file mirrors). Which installs faster, a package containing 250 files totaling 10 MB, or a package containing 10 files totaling 100 MB - hint; it depends.

      Generally, might as well show a rotating propeller or a cylon helmet moving dot, neither of which has a beginning or an end. Just an indication that something is going on, and the system doesn't look frozen. Maybe a couple of numbers under it showing # files done out of # total files.

    17. Re:Can't Go Backwards by KitFox · · Score: 2

      I know that NSIS Installers at the very least base the default progress bar internally* on the line number through the length of the entire set of installation process code. This makes it quite fun when you have long position jumps in the code or repeating loops that have enough code to cover a good chunk of progress. I would expect that several other installers may use the same base internal calculation of the progress bar.

      *The progress bar can also be controlled manually within the code for the coder to be nice or exceptionally evil as they see fit.

      --

      @Whee

    18. Re:Can't Go Backwards by rioki · · Score: 5, Insightful

      What I like is the Step X of Y types of progress indicators. Sure step 5 of 12 might take way longer then the rest but at least it is honest. It also helps to tell the user what it is currently doing. You know that downloading drivers may take a while when the internet is slow (or down).

    19. Re:Can't Go Backwards by gnasher719 · · Score: 2

      To put it another way, it is impossible to make an accurate progress bar because it is impossible to predict the future. That's all.

      A lot is just stupidity. When you copy lots of files on a hard drive, the time is proportional to some constant times total file size, plus some other constant times number of files. Lots of small files take longer than their size indicates. Most progress bars don't take that into account, so you make huge progress through a dozen 20 MB files, and then slow down through a lot of tiny files. Accounting for that alone would be a huge improvement.

    20. Re:Can't Go Backwards by CAIMLAS · · Score: 2

      Sorry, that's the wrong approach.

      The progress bar should not advance unless something has been completed. If you have it go back or have to rescale, then you should be using a different mechanism for determining completion.

      A more ideal way to do it would be with multiple process bars: a 'step' bar, and an overall progress bar. Step bars would be solely progressively linear. The progress bar would measure the steps. There are some tools which do this. The key point, I think, is that the overall progress bar should not move until both the 20 minute step and the determination telling us we've got to go another 20 minutes is completed - and the progress bar should be initially scaled for the full maximum period of time. If it's got to race to the end, so be it; it's better than being stuck at 99% for half an hour.

      You've got to keep in mind that a progress bar should serve only a couple of purposes:
      * indicate actual progress
      * indicate the process in question has not failed and is continuing

      In the quest to abstract data and provide the user with a 'pretty interface', hiding what's actually going on, #2 is often the only information being conveyed on any process which takes more than one step, takes a long time, or may be impacted by other tasks.

      Overall, I'd say most progress bars suck primarily because the developers are lazy and don't want to take the time to actually quantify how long a given task will take or how much work is involved in said step. These are not tasks programmers seem to be good at; they're better suited to people who actually understand how their systems are working (and sadly, most programmers don't seem to understand that anymore).

      --
      ~/ssh slashdot.org ssh: connect to host slashdot.org port 22: too many beers
    21. Re:Can't Go Backwards by beelsebob · · Score: 3, Insightful

      No, no it isn't. A second progress bar flickering up and down all the time tells the user nothing. Just put the one general progress bar there, and you're done.

    22. Re:Can't Go Backwards by allo · · Score: 2

      they should become longer instead of moving backwards.

    23. Re:Can't Go Backwards by AK+Marc · · Score: 2

      Then you get the progress bar from Office Space, which was making fun of the progress bars that complete, then restart.

    24. Re:Can't Go Backwards by thegarbz · · Score: 2

      I'd be happy with the bar just to indicate some form of total progress, quite unlike the latest trend in things like the Windows 7 installer. Why give a progress bar at all if it gets to the end and starts again at zero for some mythical next stage of the install progress?

    25. Re:Can't Go Backwards by jabberw0k · · Score: 2

      Except that when you install package 513, you discover that you need 357 additional new support packages for it. The total number of packages changes too.

    26. Re:Can't Go Backwards by iapetus · · Score: 2

      All these constants go out of the window if anything else starts accessing the drive as well, of course, and they're actually variable based on file system and a variety of other things.

      --
      ++ Say to Elrond "Hello.".
      Elrond says "No.". Elrond gives you some lunch.
    27. Re:Can't Go Backwards by telchine · · Score: 5, Funny

      Sure step 5 of 12 might take way longer then the rest but at least it is honest. It also helps to tell the user what it is currently doing.

      Reticulating splines?

    28. Re:Can't Go Backwards by hattig · · Score: 4, Interesting

      I hate those, they're totally pointless. "I'm possibly doing something, I don't know how much of it I've done, and I don't know when it will end, and I won't show you when I started".

      To be honest, progress bars shouldn't be used for indeterminate timescales. If you can guess a time remaining, then say that, as this can be changed, and it is visually more useful than a context-less progress bar that can go in reverse.

    29. Re:Can't Go Backwards by Anonymous Coward · · Score: 2, Insightful

      Define "fraction of job time done" numerically. Suppose you have to download 100 packages and then install them. How many % of the total should the download represent? Does the guy have cable or dialup? And how many % does the install represent? Does he have a slow USB hard drive or a ridiculously fast SSD? What if the first file downloads at 1 MBps and the 17th one at 139 Bps? I've seen that happen (varying server load, per-file mirrors). Which installs faster, a package containing 250 files totaling 10 MB, or a package containing 10 files totaling 100 MB - hint; it depends.

      I think two things are being conflated:
      * amount of work done, and left to do
      * time to do that work

      The "percentage done" (and graphical bar) should represent the amount of work, as measured by the number of bits copied (or installed). The estimated time is calculated (in a separate thread?) depending on the rate at which the work is progressing.

      Once bits are copied, installed, or downloaded successfully move the bar forward proportionally to the total amount you're going to move. As each package/file is done, check the start and stop timestamps and do a calculation.

    30. Re:Can't Go Backwards by chill · · Score: 2

      No. You're wrong.

      This is a solved problem that was done, IMHO, good enough back in the mid-1980s on AmigaDOS.

      The AmigaDOS progress bar was actually two. The top one was the entire task - like installing the application. The bottom one was the individual action, like copying a file or updating a config.

      The were separated and there was a line of text over the lower bar telling you exactly what the current specific task was. Over the top bar was a line of text with a fraction showing you the number of total sub-tasks and the number completed.

      When the top bar filled the job was done. None of this start-over crap.

      It was informative, it was non-frustrating, it was good.

      --
      Learning HOW to think is more important than learning WHAT to think.
    31. Re:Can't Go Backwards by PlusFiveTroll · · Score: 2

      Install an HP printer for the best example of this. Breaks down the install in steps, usually 3-5, and in each step it shows the name of the current file being installed as well as the size of that file.

      Too bad that HPs printer installers suck terribly. They find more reasons to fail, or just to grind and grind forever installing god knows what. I'm not really sure why their base printer drivers are over 100MB for some models. Other manufactures for models that perform similar functions will be 20-30MB.

    32. Re:Can't Go Backwards by quacking+duck · · Score: 2

      Yes and it's those--as well as those that dance left and right for no damn reason--that really piss me off.

      There's one worse: A single progress bar animation that seems like it's working normally, gets to the end.... and then *starts over* (not the entire process, just the progress bar).

      That's worse than useless, it's utterly misleading. Either code a proper progress bar, add a second progress bar to indicate overall progress (assuming the first bar keeps resetting for every sub-task), or use one of those "indeterminate" animations. The "dance left and right" bars are attempts at one, but visually make no sense. The "barber-pole" style animations that Macs started using over two decades ago are a decent implementation.

    33. Re:Can't Go Backwards by Quirkz · · Score: 2

      I saw a Mac OS 8 startup screen do something similar. It wasn't listed in percentages, but the startup screen had the empty box that the bar filled as it went. Then the filling color shot past the end of the bar and made it nearly to the edge of the screen before the whole box crashed.

    34. Re:Can't Go Backwards by ArcadeNut · · Score: 3, Insightful

      I hate those, they're totally pointless. "I'm possibly doing something, I don't know how much of it I've done, and I don't know when it will end, and I won't show you when I started".

      To be honest, progress bars shouldn't be used for indeterminate timescales. If you can guess a time remaining, then say that, as this can be changed, and it is visually more useful than a context-less progress bar that can go in reverse.

      Well, they are not pointless. They let the user know "Something is happening, but I have no idea when it's going to be done.". If you don't do something like that, then the user thinks your app has locked up and they kill the application. It's called "User feedback".

      Now on to the original theme of the story....

      Progress bars shouldn't be based on time, they should be based on quantity of work. Typically when they do the marquee style of progress bar (where it just show animations, but no actual progress), it means the quantity is unknown. This happens in a lot of situations where the total number of steps to be processed is unknown due to the data, or the amount of time it would take to calculate the total number of items would take too long.

      Progress bars should also be a different subject then Time Estimates as they are not the same. I have 100 things to process, so my progress is between 1 and 100. How long that takes depends entirely upon what I am processing. If I'm processing Invoices say, then how long it takes depends a lot on what is involved with the invoice (line items, calculations, other look ups).

      Just because it took 10 seconds to process the last one doesn't mean it's going to take 10 seconds to process the next one. In order to determine how much time is left, what most people do is take the quantity left and multiply that by the average time it's taken so far. You could apply smoothing to the average (so it doesn't jump around a lot), but other then that, how else would you estimate the time? If the amount of time it takes to process items is fairly even, your estimate will be very accurate, if they are vastly different between items, then your estimate is going to jump all over the place and be wildly inaccurate.

      --
      Visit the Arcade Restoration Workshop @ http://www.arcaderestoration.com
    35. Re:Can't Go Backwards by _Shad0w_ · · Score: 2

      A lot of the time, buried away inside that 100MB archive, there is just a small little drive file and its attendant meta data. It just they like giving you a thousand pieces of crap on top of it that you don't really need.

      --

      Yeah, I had a sig once; I got bored of it.

    36. Re:Can't Go Backwards by Duggeek · · Score: 2

      What happened with OP was, technically, an exception-handling bug. The exception was that some condition of the next event wasn't satisfied, and did so with time-sensitive language on the screen. That's not a poor progress bar, that's just negligent coding.

      Kudos for pointing out the difference with the Progress Bar and Time Estimation. A good example for both? wget

      A properly crafted Progress Bar is not hard to do: Amalgamate the task at hand into a number of homogeneous units and express those in the graphic bar as [ units.done / units.total ] and you'll be fine. Where most fail at this is in keeping the units consistent and/or appropriate. A classic fallacy is one of file-count vs. byte-count, but the most egregious of those failures is a total-units value that dynamically updates. (vis-a-vis, the "dancing left and right" progress bar)

      OTOH, there's Time Estimation, which is a far more fickle beast, especially when applied to ISP throughput. This requires more of an understanding of statistics and averages, where the algorithm is actively measuring units of time as well as units of data. A classic approach is to simply calculate the mean throughput and apply it to the bytes remaining to get the ETA, but this quickly falls short when the connection hangs or if the algorithm is relying on throughput statistics to ratchet the loop. The best—and most frugal—implementations of Time Estimation have used a timed loop with throughput calculated on a rolling average from a fixed number of samples. Again, the most common errors here are; using incorrect units; using an unreliable source for rate and/or throughput; using too small of a sample base before starting prediction trends, and the icing on the cake; mistaking a partially completed task as an accurate measurement of throughput in the sum prediction. (Back in the days of 56k dialup, I would resume d/c downloads all the time, and the download managers were regularly telling me that the 10MB chunk I already have somehow sped up the process to twice—or even ten times—the highest possible speed of my dialup connection. el. oh. el.)

      Now, all of this goes "out the Windows(tm)" if you happen to be at Microsoft any time in the past fifteen years. Their idea of a "progress bar" seems to be just a mechanism to make the user sit and do nothing for a number of minutes at a time. The progress bars they typically have made are either (A) simple timer animations that masquerade as a progress bar [see: browsing the network] or (B) the obsequious progress bars from Win98, that fill up to 100% and stay there for another two minutes before actually triggering the next process.

      Thankfully, someone in the Win8 file manager team actually got the memo, as you can see here.

      So, there's really no mystery. The "how to" of making an accurate progress bar or time estimation algorithm is really quite well established. The real question is, how to convince software developers to implement one?

      P.S. Units. Units! UNITS!!!

      --
      This post © Copyrite Duggeek, all rights reversed.
  13. Cost Benefit by infernalC · · Score: 4, Informative

    Progress bars do not make sequences of actions complete any faster. In fact, they make them slower.

    That being said, take for example an installer that must perform the following steps during an upgrade:

    0. Figure out how many files need to be replaced.
    1. Replace 30 files of varying sizes.
    2. Add 10 files.
    3. Update a half million rows inn a table with a million rows setting a column to a computed value based on some predicates.
    4. Run a third party installation mechanism (MSM?) for a supporting library, etc.

    Modern computers are time-sharing systems. Each process that involves computation is at the mercy of the scheduler in the kernel to give it the cycles it needs to complete. That means that even if you measure the time it takes to complete some process, it's not going to be the same a second time, because the installation process doesn't get undivided attention.

    Steps 0 - 2 - you're at the mercy of the IO buses, hard disk, antivirus software interfering, etc.
    Step 3 - What shape are the database statistics in? How efficiently can you apply the predicates? What does the distribution of the data look like? You can't tell this ahead of time...
    Step 4 - Does this third party installer provide you some sort of metrics as it runs?

    These are the sorts of problems to be overcome to do an accurate progress bar. In short, they aren't worth overcoming.

  14. consider a rocket launch countdown by at10u8 · · Score: 4, Insightful

    For over 50 years rocket launch countdowns have not run in a linear fashion, sometimes even being set backwards.

  15. Better than a progress bar... by 0xffffffff · · Score: 2

    ...would be a PB combined with some way for the app and OS to tell me why things have slowed down, in plain language. This would not be impossible to do.

    --
    -- This sentence is false.
  16. Re:Not hard at all by Lisias · · Score: 2

    The programmer does what the boss tell him to do.

    The Progress Bar loses his functionality when Windows 96 start to use it just as something that moves on the screen. No real processing is associated with the Bar or Animation activity!

    On the other hand, there are programs that do it right! Unfortunately, one of the best examples I have is a console Linux program: The Midnight Commander - so, very few people nowadays is exposed to a correctly written Progress Status notifier mechanism...

    --
    Lisias@Earth.SolarSystem.OrionArm.MilkyWay.Local.Virgo.Universe.org
  17. Physics! by ignavus · · Score: 5, Funny

    You can work out where you are (% completed) or how fast you are going (rate at which the progress bar is growing), but not both at the same time.

    It's simple quantum mechanics.

    --
    I am anarch of all I survey.
  18. Play Progress Quest by sidevans · · Score: 2

    They have their progress bars sorted perfectly. Great game too!

    --
    I'm not signing anything
  19. Re:no, it's easy. by GigaplexNZ · · Score: 2

    i'm a computer programmer. it's easy to make an accurate progress bar. take the total, take the current, divide. done. i don't know why windows progress bars and time estimated are so messed up. they're clearly doing something totally wrong. if not many things. as usual.

    Clearly you're not a very good one.

  20. Re:Not hard at all by fsterman · · Score: 2

    As a happy middle, we could just change the UI widget to detect when a signal is lying to it and offer up a spinning (or otherwise infinite) processing ball.

    I mean, what's worse, being stood up on a date or not knowing for sure if s/he was going to tag-along on a group activity that you invite him/her to?

    --
    Is there anything better than clicking through Microsoft ads on Slashdot?
  21. Re:Not hard at all by Gaygirlie · · Score: 2

    The computer is able to measure it's data throughput, read/write times, etc.

    Network latency, seek times, sudden Windows Update that decides to start installing packages in the middle of the process.. there's a BILLION different things that could be happening, all the kinds of things that drastically alter the speeds and therefore throwing the estimate right off the table. And that's only when you're just doing straight-up file-transfer, but what if you're doing something that requires altering pre-existing files, to boot?

    Basically I am saying that it is certainly possible to make a progress bar that mostly does what it's supposed to, but you're going to be writing lots and lots and lots and lots of code and using quite a bit of CPU-time just to keep updating the estimate at all times, not to mention that the bar must then always be written specific to that single application and task at hand. And to what end? A bar that shows an estimate for how long the process will take, nothing more -- all the time spent coding the bar could be used to do bugfixing, providing new features or honing existing ones and the CPU-time could be used by other programs or to, you know, do something more useful in the meantime.

    Mandatory Car Analogy: I know that if my speedometer indicates 60 miles/hour, that in one minute I will have travelled one mile. That's predicting the future son!

    If you were to compare this to computers then you'd have things like sudden goose swarms jumping right in front of the car at unexpected times, all 4 tires losing friction, a bunch of other drivers on a single-lane road and all fighting each other for the privilege of getting to drive as first of the line, your car suddenly starting to perform maintenance and cleaning on itself while you're trying to drive, mandatory pit stops at variable distances and you having to always perform this or that manual task when you reach one, and so on. Does it sound so easy at this point?

  22. Re:Crappy software by Jiro · · Score: 5, Informative

    The progress bar on the HTTP download doesn't show the amount of remaining time in the bar. It shows the number of bytes remaining in the bar; the number of bytes remaining can't go into reverse. The time remaining is showed as a numeric value for how long it would take assuming the speed is the same as the speed so far; if the transfer suddenly slows down, this value can go into reverse.

  23. Because it should be a graph. by gargleblast · · Score: 4, Interesting

    It is hard to make an accurate progress bar because it shouldn't be a bar at all - it should be a graph.

    Consider the humble download: bytewise, it might be 97 percent complete, but at the last moment, the bps rate has fallen. With a progress bar indicating a percentage and an estimated time, it might say 97% complete, 3 seconds to go. If the progress indicator was a graph, you could tell that the bps rate has fallen, and that the 3 seconds to go estimate (probably based on a linear extrapolation of progress to date) does not apply.

    I have never seen it done though. Partly, because I have never done it.

    1. Re:Because it should be a graph. by Anonymous Coward · · Score: 3, Informative

      Windows 8 actually has this.

      Screenshot: http://stackoverflow.com/questions/14064017/is-there-an-api-for-the-windows-8-progress-dialog-api

    2. Re:Because it should be a graph. by gargleblast · · Score: 3, Informative

      Holy crap, there it is: http://developers.slashdot.org/comments.pl?sid=3456137&cid=42879657. Thank you, PlusFiveTroll!!! Thank you Windows 8!!!

  24. We will have an accurate progress bar when ... by Phantasmagoria · · Score: 3, Insightful

    ... when we solve the halting problem. I'm not entirely joking. The main problem with progress bars is that, quite often, it is not possible to accurately estimate how much time is needed to complete a problem (i.e. for the program to halt).

    --
    Loban Amaan Rahman ==> Anagram of ==> Aha! An Abnormal Man!
  25. The 99%... by DavidD_CA · · Score: 4, Insightful

    The public opinion of the Progress Bar would be considerably more favorable if programmers would simply treat 100% as if it were 75%.

    In other words, do all the stuff you have to do, measuring progress and whatnot, but when you're actually at 80%, report yourself at 60%. Likewise, when you're at 95%, say you're at 70%.

    Then, only when you really are completely finished, you jump from 75% to 100% in under a second.

    Complaints gone.

    --
    -David
  26. You know what I'd like to see? by k3vlar · · Score: 5, Insightful

    You know what I'd like to see more than a working progress bar? A "Cancel" button that actually stops the f*%! process! .
    I don't want to finish the sub-process I'm currently doing (which has probably stalled)... just FREAKING STOP.

    If you (programmer) want to close connections, or save the changes to the disk, do it in the background. Making me sit there for another 10 minutes while you're "cancelling..." is not helpful. I will force close your program. Failing that I will hard-reset the computer. Seriously.

    --
    Unlike porn, which yada yada rimshot hey-ooh!
  27. Re:Crappy software by nabsltd · · Score: 5, Insightful

    Give this man some upward moderation.

    The problem is that the question is wrong. It's trivial to make a progress bar...just sum up all the things you have to do, and move the bar each time a "thing" is done, rounding to the nearest pixel. It doesn't matter if the "thing" is a byte to copy, a file to install, or any generic task. As long as you can add one to a counter each time you have done another "thing", you can then display it graphically.

    The actual complaint is about displaying accurate time remaining to complete the task, which really has nothing to do with the display of the progress bar. Instead, it involves guessing about how long each remaining "thing" will take to complete, and then displaying that sum of those times. This is hard because no matter how accurate the data used to make the guess, something outside the control of the program can disrupt the processing.

  28. Re:Sort of. by AlphaWolf_HK · · Score: 3, Interesting

    I like the new windows 8 transfer bar that shows instantaneous transfer rates (not average) as it progresses left to right. This gives you a very accurate idea of when the transfer will finish, as it can slow down or speed up based on either network congestion or file size (a bunch of small files transfer slower than few big files.)

    --
    Careful with names containing L slashdot.org/~AiphaWolf_HK slashdot.org/~AlphaWoif_HK slashdot.org/~AiphaWoif_HK
  29. Re:Predicting the future is hard by RedHackTea · · Score: 2

    Once you know the past, it gets a little easier. I actually had to do this for a customer. A SQL select statement was taking about 5 minutes (lots of data), so the initial progress bar would be stuck at 1%. Knowing that it took about 5 minutes from testing, I increased the progress bar's total and incremented at a rate of 10 seconds appropriately via variable X -- which was initially stored as 5 minutes for all clients. Every time each client performs the operation, it computes the new time it took and adjusts variable X accordingly for each specific client. It's actually quite accurate now. However, the equation is trivial and only computes an average. An artificial neural network could perhaps make it even more accurate. But, if you don't know the past, then yes, predicting the future is hard.

    --
    The G
  30. We will have .... by PPH · · Score: 5, Funny

    ... a functional progress bar in 5 years.

    No, wait. It seems to have stalled.

    --
    Have gnu, will travel.
  31. Re:Not hard at all by jones_supa · · Score: 2

    Have you tried PowerShell? It has replaced the "MS-DOS Prompt" if that is what your experience is of. In some ways PS is more advanced than UNIX, for example it allows you to pass data in an object-oriented fashion, avoiding the need to constantly parse data delimited with spaces with various commands (awk, sed, xargs...).

  32. It's a Prediction of the Future by dcollins · · Score: 3, Insightful

    "How come after 25 years in the tech industry, someone hasn't worked out how to make accurate progress bars? This migration I'm doing has sat on 'less than a minute' for over 30 minutes. I'm not an engineer; is it really that hard?"

    Yes, because all progress bars are inherently a prediction of things that will happen in the future. If there is any error condition, unusually large blob of data or weirdly structured hard drive to read from, varying bandwidth bottleneck, fritzy peripheral not responding as expected, etc., etc. times a million, then the unusual event will make the prior prediction incorrect and look silly in retrospect. As long as there is any "if-then" clause or error handling in the branches in the system, then the unexpected can happen and make the prediction (progress bar) invalid.

    It's analogous to weather prediction. It can't be perfect, it's an extrapolation, but people will always complain about it.

    --
    We know where leadership by an anti-intellectual "strongman" who scapegoats minorities and likes boisterous rallies goes
  33. Ooo 'e wants a progress bar! by Greyfox · · Score: 2
    We'll be sure to take a resource off of developing the application we're selling and get him right on that! Oh, no it's quite all right, the schedule's slipped 14 times since we started, but the schedule can just take one for the team, can't it? After all, you have to know how long that thing you're going to do ONE TIME is going to take! It's not like your computer can do TWO THINGS or anything! We wouldn't expect you to do something ACTUALLY PRODUCTIVE rather than watching our progress bar!

    Is why.

    Hmm. I wonder if I wrote an app that was nothing BUT progress bar, if people would go for it.

    Some developers have already come to the conclusion that installation is a prime advertising timeslot. So even if anyone was inclined to write a progress bar, it'll still end up ad-laden and annoying.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  34. Simple solution by DerPflanz · · Score: 3, Insightful

    Show progress of the work, not the time. You never know what other things the machine is doing, and is better to give no estimate than a bad one.

    And don't suffice with a bar, also provide information on what the process is doing.

    --
    -- The Internet is a too slow way of doing things, you'd never do without it.
  35. Solved Ages Ago by ae1294 · · Score: 3, Funny

    This problem was solved a long time ago... I still wonder why people don't know how to code a proper progress bar...

    HOWTO:

    Setup bar, value set to 0%
    Create link-list of all files to transfer with their size in blocks, zeroed time in msecs, & Boleyn value for iftransfered.
     
    Transfer available buffer * 2, update link-list times for each file transferred and mark iftransfered true. Use following file selection method from link-list choices:
     
    Rand(Total files).
    iftransfered = True then +1 until false or (Total Files) reached.
    If (Total Files) reached then -1 until all files transferred = True.
     
    Calc buffered transfer & unbuffered transfer times using link-list data.
    Update untransferred files link-list times based on above using 71% weighting of unbuffered over buffered times.Update display
    Transfer 1x buffer update link-list & evail difference between first and second transfer. Adjust weighting using following:
     
    Pick random # between 1 and 661 + 42^2 * last weighting.
    Divide until less than 100.
    If less than 89 then random # above - sqrt42 * first weighting.
    Again divide until less than 100.
    If less than 41 then transfer 4x buffer. repeat buffered time weight calc. goto pick random 1 and 661 step.
    If above step repeats more than thrice adjust plank constant up by 11.11% & factor new weightings. Store in reg.
    If above above step repeats more than 7 times adjust plank constant down by 11.11% and factor new weightings. Store in reg.
    Update display, if greater than 100% than 100%.
    If number is irrational do 2D4 damage unto number until it becomes rational again. update display.
    Continue transfiguring & updating link-list and weights as above so as below.
    If time remaining goes negative check if users name begins with bob. Display Improper observer, recalc from start with different observer.
    If time goes infinite check on cat. If dead display Improper universal constant detected. Invert plank constant. recalc from start. Store regValue TimeFlow Inverse = True. Check at start to avoid problem. NOTE: program should check that user has not switched universes every x transfers or in background test transfer at idle.
    If above happens thrice then cthulhu re-entering universe probability approaches infinite. Halt transfer. Terminate user. display greetings...

    I've left out the easy stuff but this provides for a 99% correct est. Please note that the computer must be from 1 year in the future for this to exceed 87% correctness without causing time dilation within progress meter by blocks remaining^66 msecs. Check Mfg date at start and adjust time est accordingly.

    The above is copy-written and my not be used....

  36. Re:Crappy software by Zadaz · · Score: 4, Insightful

    Except even the number of tasks is often variable over the life of the task.

    Take for example loading a web page. It starts out as 1 task: Get a page from the server. Once you've done that, how many more requests will that first request generate? Impossible to tell. It could be none. It could be hundreds, and some of those can generate their own requests. (etc, etc.)

    The answer is this: Some feedback, no matter how incorrect, is better than no feedback at all.

  37. outline format by hierophanta · · Score: 3, Insightful

    Progress should be reported to the user in outline format. Give the user the list of tasks that the computer is working on, show progress in each task. This is much more informative, and as a user - i'd feel more intimate with the process and in turn more trusting. also this might allow me to troubleshoot things that are moving slowly. some games are great at this, i've never seen it in an OS though.