While that speed increase is real, of course, you're really just looking at the general speed delta between Python and C there. To be honest I'm a bit surprised you didn't get another factor of 2 or 3.<p>"Cimba even processed more simulated events per second on a single CPU core than SimPy could do on all 64 cores"<p>One of the reasons I don't care in the slightest about Python "fixing" the GIL. When your language is already running at a speed where a compiled language can be quite reasonably expected to outdo your performance on 32 or 64 cores on a single core, who really cares if removing the GIL lets me get twice the speed of an unthreaded program in Python by running on 8 cores? If speed was important you shouldn't have been using pure Python.<p>(And let me underline that <i>pure</i> in "pure Python". There are many ways to be in the Python ecosystem but not be running Python. Those all have their own complicated cost/benefit tradeoffs on speed ranging all over the board. I'm talking about pure Python here.)
by jerf
|
Feb 4, 2026, 1:39:25 AM
Looks like an interesting project; thanks for open sourcing.<p>Although I'm continually hammering the daylights out of message/job queues, I never seem to have the time to do simulations like this. Kinda hoping that the increased leverage I've been getting from LLM-assisted coding lately might actually free me up to finally do some of these type of tests.
by bradleyy
|
Feb 4, 2026, 1:39:25 AM
Looks really cool and I'm going to take a closer look tonight!<p>How do you do the context switching between coroutines? getcontext/setcontext, or something more architecture specific? I'm currently working on some stackful coroutine stuff and the swapcontext calls actually take a fair amount of time, so I'm planning on writing a custom one that doesn't preserve unused bits (signal mask and FPU state). So I'm curious about your findings there
by anematode
|
Feb 4, 2026, 1:39:25 AM
Didn’t read the code yet, but stuff like this tend to be brittle. Do you do something clever around stack overflow, function return overwrite or would that just mess up all coroutines using the same stack?
by sovande
|
Feb 4, 2026, 1:39:25 AM
I don't know enough about event simulation to talk API design in depth but I find the stackful coroutine approach super interesting so I'll be taking a look at the code later!<p>Do you plan on accepting contributions or do you see the repo as being a read-only source?
by quibono
|
Feb 4, 2026, 1:39:25 AM
How does this compare to Mojo?<p>Edit: nevermind. I answered the question for myself w/ vibe coding: <a href="https://pastes.io/mojo-event" rel="nofollow">https://pastes.io/mojo-event</a>.<p>Workers: 1 | 2 | 4 | 8<p>Time: 12.01s | 8.01s | 5.67s | 5.49s<p>Events/sec: 16.7M | 25.0M | 35.3M | 36.4M<p>Obviously just a first pass & not optimized b/c I'm not a mojo expert.
by measurablefunc
|
Feb 4, 2026, 1:39:25 AM