Performance impact
pafnow opened this issue · comments
Hi,
Thanks for this module, it is a really good enhancement, and i'm using it often now.
However, I have noticed that using this progressbar seems to have some impacts on the performance/speed of the process.
For example, without progressbar, the progress takes around 30 seconds, but with the progressbar, it will take 1min30.
I am the only one to notice this ? Is it expected ?
Thanks
Hi,
Thanks!
The performance impact depends on the processing cost of a single iteration.
It should be negligible for relatively costly iterations, like db access (mesured in miliseconds). However, it may be significant for very light computations, like in-memory computing.
Can you share the nature of your iterations which give you the 200% overhead? How many iterations per second?
Please note that the progress is reported to the log and to the web client every 5 seconds, so having too many iterations per sec. does not make much sense. If this is a case, I would recommand dividing the computation in batches and measuring the progress of batch completions.
Best,
G.
Hi, thanks for your answer,
It is indeed a mostly in-memory computing process, with around 2000 iterations in the use case described before.
So it is 70 iterations per second without progress and down to 25 with progress bar.
I understand your idea of using batches, will try to see how it can fit nicely in the code (ideally adding a function on BaseModel to make it reusable).
Surprising. 70 iterations per sec should not be a big deal. What is your Odoo version?
Odoo v14