C5 GUI: slow to close
The C5 GUI can be VERY slow to close (while making intensive use of the processor) in some circumstances.
Here is one way to observe the slowness:
Fact(100000); --> produces long output L := 1..20000; S := sorted(L); --> takes several seconds, interrupt the computation using "stop" button
If you now decide to quit the C5 GUI by selecting "quit" from the "file" menu, it takes several minutes to close the window (blocking the cursor as a coloured wheel on MacOSX).
#1 Updated by John Abbott about 3 years ago
- Priority changed from Normal to Low
The window closes quickly if you do not first compute (and print)
Needs more investigation to discover what exactly is the cause.
Some more experiments:
Fact(100000); -- SLOW
N:=Fact(100000); -- FAST
N:=fact(100000); N; -- SLOW
Fact(100000); 1; -- SLOW
At this point I am inclined to guess that the presence of a long line of output is what causes the slow closure.
#3 Updated by John Abbott about 3 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 10
Closing is practically instant if I do first a "Clear output window" and then close the C5 GUI. This suggests that closing the GUI should probably call "clear output window" first, and then close.
I'll have a look at the code to see if this can be added quickly and easily.
Note: on my machine it took 60s of CPU to close the GUI when I had computed and printed
#6 Updated by John Abbott almost 3 years ago
- % Done changed from 10 to 50
I've hacked the code to make a call to
clearOutputWindow, and it now seems to close much faster (after printing
I had to make the mem fn
clearOutputWindow public (previously it was private), and add a boolean arg to avoid asking the user for confirmation prior to closing the output window.
It compiles and runs for me. I'll check in soon; with luck we can test it on other platforms before releasing.