How about Haskell's GC performance for soft realtime application like games?

寵の児 提交于 2019-12-18 14:01:04

问题


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)


回答1:


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




回答2:


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.




回答3:


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

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



来源:https://stackoverflow.com/questions/4482987/how-about-haskells-gc-performance-for-soft-realtime-application-like-games

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!