Closed latot closed 1 year ago
Thank you @latot for your idea and thorough explanation, but unfortunately, I can't do that. It is very convoluted, it would be hard for me to even explain in the README how to use it... And mostly, I think your previous idea captured the essence here and might benefit a lot of people, without any complicated mechanisms on top of it. Thank you!!
Okis!, thx too :)
Hi all!, this idea was inspired initially from https://github.com/rsalmei/alive-progress/issues/215
The start point is that, we in a flow we can have more than one function or way to process items, this causes to every one of them have a different way to estimate its own time, picking an example from the issue 215.
Well, one way is as the issue tells have a way to ignore that particular element in the calculation of estimated time, that is a good way but I think there is two points that can be handled too:
The idea (or as a base to create a new one) I propose to solve the issue 215 and the points above, is the
bar
have acategory
like this:Now to shoe the average time, generate groups based on the category, in this case example:
Then calculate the estimated time of every group, there is several ways, this project seems has its way, just to illustrate lets use the normal average:
Now, we can suppose the current proportion of all the categories will work over all the elements we want to process, this is not true for a small sample, but should be closer to the reality in several cases and when we have a bigger number of samples.
Lets pick the total elements as 10000
Total estimated time to finish all:
55s*0.25 + 0.5s*4 + 0.25s*1 = 16s
(average), then16 * 10000segs = 16000s
Remaining time:
16000 - elapsed time: 16000 - 2*55 (func1) - 4*11.25 (func2) - 2*1 (skip) = 15843s
Due to this method, multiply by the average time to get the elapsed time just returns the true elapsed time, maybe we should just substract the true elapsed time.
With this data we can show average time per operations, or show the average by category, there is a lot of options from here :3
Maybe the normal average is not the best for several part of this calculations, but remember is just to explain the concept :)
The concept to categorize different calculations for estimations ends there.
There is one other concept I would like to integrate here, changes a little some sections, but is a complement concept, and is use a number to change the "weight" of ever time in a particular function, like if
func1
runs over a list, we can pass tobar
the array size, use it as a "weight" for the estimation (the total time would be split by every category, and every category should have different times with its own weights). But before that, If ppl like the idea above I'll write this other one deeper.Personally, I never thought too much in good time estimations before, I never needed it, but today I'm working, and I learned good estimations are necessary to know how much time we need, is great indeed!
Thx!