Slug #750
C5 GUI: very slow when printing many short lines
Description
The GUI takes ages to print out the following:
indent(1..100000);
No idea why :-( "top" says my computer is 88% idle... odd!
Related issues
History
#1 Updated by John Abbott almost 7 years ago
- Related to Bug #1093: GUI: bugs and slugs added
#2 Updated by John Abbott over 1 year ago
2022-08-18: JAA confirms that this slug is still present.
It suffices to test indent(1..1000)
top
reported that gnome-shell
was using about 30% CPU.
I wonder if output is too often flushed?
#3 Updated by John Abbott over 1 year ago
- Status changed from New to In Progress
- % Done changed from 0 to 10
I created a single string containing many new lines: this printed instantly.
jaa := "jaa\n"; S := ConcatStrings([jaa | i in 1..1000]); println S; --> instant in GUI
This does make me wonder whether "println" causes a costly flush.
A workaround could be to make indent
return a string rather than calling println
many times.
The code would stay almost the same, except it would print onto an OpenOString
.
#4 Updated by John Abbott over 1 year ago
- Related to Design #1698: indent: return a string? added
#5 Updated by John Abbott over 1 year ago
- Status changed from In Progress to Closed
- Assignee set to John Abbott
- Target version changed from CoCoA-5.?.? to CoCoA-5.4.2
- % Done changed from 10 to 100
- Estimated time set to 1.23 h
We do not really have the resources to investigate and fix this.
While the "slow newline problem" is not ideal, it is also not so
very serious.
We close this issue because: severity low, difficulty/time great.