dolphinsmalltalk / Dolphin

Dolphin Smalltalk Core Image
MIT License
301 stars 58 forks source link

Unexpected delay forking a process #1189

Closed jgfoster closed 1 year ago

jgfoster commented 1 year ago
5 timesRepeat: [
    | t |
    t := Time millisecondsToRun: [
        [] forkAt: Processor userBackgroundPriority.
    ].
    Transcript show: 'fork to background took ' , t printString , ' ms'; cr.
].

The above produces times ranging from 250 to 300 ms. I am running emulated on an ARM processor in a virtual machine on macOS so am not surprised that things are a bit sluggish, but this seems surprising.

blairmcg commented 1 year ago

Judging from your other bug report, I suspect you are running with a debug VM. The debug build is not intended for normal use, so I strongly recommend not doing that. It will be significantly slower in general, and especially so for certain operations (x10 or even x100). In some cases behaviour will be different due to timing or different code paths. It does not give an accurate representation of how your code will behave on the normal VM and is only intended for debugging the VM in constrained scenarios.

When I run your expression natively, I get:

fork to background took 0 ms
fork to background took 0 ms
fork to background took 0 ms
fork to background took 0 ms
fork to background took 0 ms

It might be a bit slower in your emulated environment in a normal VM, but if it is that wouldn't be a surprise as you say. If it is still significantly slower emulated vs native on the release VM build, then that really isn't an actionable bug for Dolphin.

jgfoster commented 1 year ago

That would explain a lot! I'm working on a rebuild now...

jgfoster commented 1 year ago

UPDATE: I poked it several times and it now seems to have built without error...

My rebuild attempt gets an error: "Cannot open include file 'ActiveXHost.h': No such file or directory". I believe I'm up-to-date and did a clean and build of 7.1.

jgfoster commented 1 year ago

Yes, I was running a debug build without realizing it. It seems that the change happened about the same time I got a new machine (ARM instead of x86) and blamed it on all the performance issues. Now Jade is back to its snappy performance. Thanks so much (I'm giving a demo this afternoon at ESUG).

blairmcg commented 1 year ago

UPDATE: I poked it several times and it now seems to have built without error...

My rebuild attempt gets an error: "Cannot open include file 'ActiveXHost.h': No such file or directory". I believe I'm up-to-date and did a clean and build of 7.1.

Yes, there is a project dependency issue. When switching between release/debug, you'll need to do a complete solution rebuild. Seems you got past it though.