I am currently learning Haskell for fun because I always wanted to see how you design programs in a non object orientated sense.
But I am also researching if it is useful to use Haskell for a game engine. My main concern is the GC.
I know that GHC is concurrent and thread local.
I read that the GC usually pauses between 1ms-5ms. I know that it is different for every program, but still I need some numbers to make some calculations.
Let's say my game runs at 60fps
that means every frame needs 0.016666667s
of calculation right? A gc pause would increase this to ~0.017666667
which results in 56fps
. So it s a performance loss of ~4fps
or 7%
. For me that is a pretty big hit.
Now I am counting on the thread local GC because I want my game engine to be highly concurrent.
I want to use the Actor model for the game code so every entity will have it's own memory. If I am right this means that every entity has it's own local garbage collection.
But the main problem is still the game engine with it's main loop. Random fps drops of 7% is pretty big.
Are my calculation correct? Any recommendations that you can give me?