How about Haskell's GC performance for soft re

2019-02-07 20:49发布

Because I realized game rule logic should handle huge complexity, I'm considering using of non-typical language in game field as in-game logic script language. The reason of in-game script is representing complex logic with less code. So extremely well abstracted language required.

But most well-abstracted languages use GC. And normally the GCs make CPU burst load. Basically it defers clearing memory operation, and do it at once. Really critical to realtime graphics including games and GUI.

AFAIK, Haskell's GC is little bit different with other GC based languages cause of it's immutable attribute. It's hard to imagine. I couldn't find any document this in detail.

What's different? And is it CPU burst free for long running programs? (well distributed load over time, manual complete GC command can be called for each tick)

3条回答
我命由我不由天
2楼-- · 2019-02-07 21:08

You may be interested in this blog post by Simon Marlow about moving GHC from stop-the-world collection to something more concurrent with pause times more suitable for soft real-time applications such as games.

I haven't benchmarked GHCs latency profile myself but, as I understand it, those 0.0007ms pause times may seem small but they are proportional to the heap size which is tiny for that toy tic-tac-toe program so real heaps and pause times will be orders of magnitude larger.

查看更多
Ridiculous、
3楼-- · 2019-02-07 21:29

You may want to look at the thread initiated by Luke Palmer here : http://www.haskell.org/pipermail/haskell-cafe/2010-February/thread.html#73881

查看更多
狗以群分
4楼-- · 2019-02-07 21:31

You might be interested in the commercial Haskell game, Nikki and the Robots, released in 2011 by Joyride Labs.

enter image description here

They don't seem to be having any trouble with having a garbage collector.

查看更多
登录 后发表回答