Subject: | Feature requests: Progress indicator for long indeterminate tasks |
Date: | Mon, 22 Mar 2010 21:37:39 -0700 |
To: | bug-smart-comments [...] rt.cpan.org |
From: | Ryan Thompson <rct [...] thompsonclan.org> |
Hi,
I use smart comments a lot to indicate progress in reading through
large files. Since I don't know how many lines are in the file, I
can't use a progress bar, so I have to use "% lines read" as a
progress indicator. (I can't use the "hurry-up-and-wait" because the
"hurry-up" part finishes too soon, and I end up with a 99% progress
bar after only a minute.)
Anyway, I have a couple of requests for making Smart::Comment's
progress indicators work better with large tasks of indeterminate
length, especially when individual iterations . First, it would be
nice to also be able to specify a spinner (using e.g. Term::Spinner)
instead of or in addition to a progress bar. Second, after the first
few seconds (probably at the same time the remaining time is first
shown) , the update rate should be limited to once per second, so that
in a very fast loop, updating the screen does not become a significant
drain on resources. Of course, I'm assuming a screen update is more
expensive than a check to see whether or not the screen should be
updated.
Lastly, some way of specifying the initial fill rate for
"hurry-up-and-wait" bars in order to give them more time before
filling up would be nice, though this would probably complicate the
syntax excessively.
In case you're wondering, the long-running task is reading and doing
something with each of 300 million short DNA sequences using Bioperl,
and it ran significantly slower with Smart::Comments enabled (though
not slow enough that I was willing to disable it and lose the progress
indication). The loop does several thousand iterations per second, so
presumably it's updating the screen several thousand times per second.
Thanks,
Ryan Thompson