this post was submitted on 21 Nov 2023
1 points (100.0% liked)

Lisp

53 readers
3 users here now

founded 1 year ago
MODERATORS
 

Hello,

I'm working on a game in Rust but interested in trying out (SB)CL. That being said I'm worried about GC pauses for the type of game I'm making and would like to create a relatively simple benchmark to gauge the level of inconvenience this would cause me. I'd like to do this upfront since I already have a decent bit of progress on the Rust side. Originally the game was being developed in Godot but it ended up being a little too CPU heavy for GDScript (not GC related as far as I could tell, but they have reference counting over there). Then I migrated to Rust and performance-wise everything is working great, but I've been wanting to try CL for a while now and I can afford a couple of weeks of distraction...

How can I benchmark the GC? I know something I can try is simply calling it at the end of every frame and measuring the time there, but I'm curious about how to time it in its default settings.

I also saw: https://groups.google.com/g/sbcl-devel/c/VAA4SkQo3jM But as someone unfamiliar with SBCL development, is this GC something that we can expect to see within a year or two? I'm eager to try it, seeing as the author of that post stated:

The longest a thread should ever be "paused" (not doing its own work) is about 100 microseconds. "paused" actually means doing work for the GC.

Which sounds fantastic, not even 1ms at its highest.

you are viewing a single comment's thread
view the rest of the comments
[–] Decweb@alien.top 1 points 1 year ago

You might read docs about some CL based games, like Khandria, where they talk about dealing with gc. (TL;DR, not a major problem). Sorry, I don't have a link for you.

Note that you can also work to writing less consing-intensive code too (more preallocated data structures, efficient use of fixnums, the stack, and lisp-specific extensions that allow you to do more tricks with the stack or malloc()'d memory.