Tech News
← Back to articles

Show HN: C discrete event SIM w stackful coroutines runs 45x faster than SimPy

read original related products more articles

A multithreaded discrete event simulation library in C

What is it?

A fast discrete event simulation library written in C and assembly with POSIX pthreads. Simulated processes are implemented as stackful coroutines ("fibers") inside the pthreads.

Implementation status:

x86-64: Stable, both for Linux and Windows

Apple Silicon: Planned

ARM: Planned

Cimba models run 40-50 times faster than SimPy equivalents. The chart below shows the number of simulated events processed per second of wall clock time on a simple M/M/1 queue implemented in SimPy and Cimba. Cimba runs this scenario 45 times faster than SimPy with all CPU cores in use. Cimba runs 25 % faster (20M events/sec) on a single core than SimPy using all 64 cores (16M events/sec).

Why should I use it?

It is fast, powerful, reliable, and free.

... continue reading