News for hackers. Stuff that matters.
Re:Making PyPy's GC and JIT produce a sound [video] by abeppu on Thursday August 22, 2024 @01:09PM (#41322284)
> - the two different coin sounds are played when the JIT produced a new chunk of machine code.

... as a thing for a human to listen to, it sounds like a lot is going on. But as an indicator of what's happening inside a VM in 2024, is this surprisingly slow? Especially at the intro, if you were paying close attention, you could manually count these events.

Re:Making PyPy's GC and JIT produce a sound [video] by chc4 on Thursday August 22, 2024 @01:52PM (#41322741)
The point of a JIT is to optimize code that is, roughly, the largest percentage of program time. Most programs follow a power distribution where there is some very important code that is ran a lot, with a lot of code that isn't ran very often (or worse, only ever once). If you JIT compile the N highest impact parts of the code, then you get the highest impact without actually needing to process that much code - which is extremely important, because the act of JIT compiling is very slow and only should be done when it's likely profitable in terms of execution time to waste so many cycles compiling code, with the expectation that you will make it back by making it N cycles faster every time it runs in the future.
Re:Making PyPy's GC and JIT produce a sound [video] by cfbolztereick on Thursday August 22, 2024 @03:54PM (#41323852)
Yeah, that's a good point!

The 'empty' parts of the beginning of the program are actually a 'configure' phase, where the program runs a bunch of subprocesses (C compiler with small query programs) and the vm is mostly waiting for the results of that. That's why there are pauses in the coins.

On the other end, I also artificially limit the samples to 10 coins a second (iirc), because if the jit is really compiling a lot it would be just too annoying.

Re:Making PyPy's GC and JIT produce a sound [video] by diath on Thursday August 22, 2024 @01:27PM (#41322470)
Infrequent would be a better word than slow, not all interpreted code is JITtable, and code that was JITted already will probably be cached.