Skip to content
Prev 60769 / 63424 Next

Windows Rgui.exe 4.2.0: Call of txtProgressBar() slows down dramatically after subsequent calls

On 5/19/22 23:18, Tomas Kalibera wrote:
Now fixed in R-devel and R-patched (revision >= 82389 of R-patched).

It turns out that Rgui always keeps a buffer of all the text including 
the \r, but the overhead was poor performance of computation of 
character widths in a multi-byte locale, which is now improved. I've 
also changed the memory allocation in the relevant code to use the heap 
instead of the stack, which should fix the issue with stack overflow 
Tobias experienced while testing.

The progress bar/printing would be more efficient if the line buffers in 
Rgui could keep already pre-processed \r(s), but that would require a 
somewhat bigger change, and hopefully it won't be needed.

Thanks a lot for the report and the nice small reproducible example.

Best
Tomas