> On Jul 25, 2017, at 12:45 AM, Lehi Toskin <lehi.tos...@gmail.com> wrote:
> I have noticed that printing in DrRacket is rather slow and I'm wondering if 
> that's something I could speed up. If I have a loop that runs and prints a 
> whole lot of information each loop, were I to become overwhelmed and click 
> the Stop button, it would take a minute or so before my wishes made it 
> through to the program.
> Running the same hypothetical program from the command line, the printing 
> process is executed much faster and if I Ctrl-C the change is instantaneous.
> Am I making any sense?

Yes. This is a well-known fact and you have gotten great responses. 

1. If you are asking whether you could study the code of DrRacket’s simulated 
console I/O in order to improve it, the answer is “of course!” but Robby has 
spent a good amount of time on this issue and Matthew has engineered the 
underlying code (the GUI framework) to some extent. Whatever you find to 
improve this code, great! Submit PRs. 

2. If you are wondering what to do when running a program you need, there are 
two answers: 
        — use the command line if you want console output 
        — use the GUI framework to build a widget if you want GUI output 

As for the time it takes to interrupt a running thread, DrRacket is a mini OS 
(in the sense of a resource managing system) and thus needs time to swap in the 
thread that kills and to kill the thread that runs and to collect the memory 
that came with it and all. There’s quite a pipeline it takes down. 

— Matthias

You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to