vibe-d / eventcore

High performance proactor event loop abstraction library
MIT License
60 stars 42 forks source link

Creating and waiting on timers causes GC allocation every time - expected? #186

Closed kookman closed 1 week ago

kookman commented 3 years ago

Is this expected? I know @s-ludwig has said on other issues that eventcore is not @nogc, but I would not expect something as high frequency as timer creation to allocate from GC heap every time. It appears from cursory reading of the code that there is an idea of using a freelist for these?

Note timers are created and waited on in practice called for every read operation from vibe-core - see: https://github.com/vibe-d/vibe-core/issues/278. This means two GC allocs per read. Not a deal breaker, but definitely a hotspot for GC allocation in my testing.