Hacker News new | ask | show | jobs
by kstrauser 1937 days ago
I've thought about this so many times. I imagined a config file that listed stages with what resource they used most and how much of that resource it might take, like:

- Vendor: Foo Corp

- "Downloading files", Internet, 1000 MB

- "Extracting files", Disk, 2000 MB

- "Copying files into place", Disk, 4000 MB

- "Configuring", CPU, 100 seconds

The library would generate a progress bar that you'd update like:

- progress('Extracting files', 100), progress('Extracting files', 200), etc.

It would learn that 100MB of disk IO takes about this much time, and downloading 100MB from the Internet takes so long, and so forth. And the thing is, the estimates wouldn't even have to be particularly good as long as they were reasonably consistent for all of the same developer's projects. If CPU bound process #1 takes 10 seconds on the developer's laptop, and CPU bound process #2 takes 20 seconds, then the library could see how long the first takes on the user's hardware and then double it for the starting estimate of the second process.

I'd love so much for this to exist.

Edit: because of your comment I finally got around to writing this up at https://honeypot.net/post/smart-progress-bars/

1 comments

Drawback: All that processing about how much to advance the progress bar under what circumstances on which hardware, etc. pp. takes so much CPU cycles that the actual task takes 3 times as long compared to a "stupid" progress bar.
I started implementing it last night, and the cost for a simple weighted average model was basically free.