I spent nearly my entire train ride to work profiling my spatial partitioning code and trying to optimize it so that it doesn't slow to a crawl with more than ~600 objects in it. unfortunately I didn't really get anywhere besides learning that the main issue is way too much GC. I don't know how I can possibly cut down on the amount of allocation.


I thought that I had indentified the main issue which is that inexact->exact, a procedure I call a lot, allocates memory. however, when I replace that procedure with a memoized version it doesn't seem to reduce GC footprint at all.

@dthompson ye olde "argh GC pauses are cramping my game style" problem

As an aside, I wonder if incremental GC reduces this friction

@cwebber I don't actually have a problem with occasional stop-the-world GC, like Guile does. if it's happening only once every few seconds you don't even notice. my problem is that I'm generating so much garbage that the GC is running multiple times per second and basically nothing else can get done. I need to find the sources of the allocation and remove them, but I've just been having a rough time figuring out who's to blame.

@dthompson I empathize... right now I'm having a problem in Goblins where memory is not being GC'ed and it's very hard for me to figure out *what* is holding onto things and keeping those references alive...

@cwebber finding memory leaks is tough and not many languages provide tools for figuring it out. the rails application I work on at $dayjob leaks memory but multiple people, myself included, could not find the source even though Ruby can dump a heap log, complete with object references. it's tough!

@dthompson memory is hard

get ready for the memoryless computer revolution

@cwebber the only thing that ever works for me, and it only works when the program isn't massive, is to just remove a bunch of code and see if the problem goes away and keep "bisecting" until you find the code you're looking for.

@dthompson yes, the problem for me is the problem was introduced during a major rewrite

*what* in the rewrite caused the change? It's hard to tell, because so many moving pieces were changed...

@dthompson however it could be that the problem has already been fixed in racket's master branch.... I should try compiling it..

@dthompson (I uncovered two bugs at once, one definitely was a racket problem and related to their gc, one maybe a my problem)

@cwebber hopefully it compiles a bit faster than guile master...

@dthompson I say this based on how long it takes guix to compile it when substitutes aren't available

@dthompson nonetheless, people were complaining about it at racketcon

Sign in to participate in the conversation

A Mastodon instance for cats, the people who love them, and kindness in general. We strive to be a radically inclusive safe space. By creating an account, you agree to follow our CoC below.

Instance Administration

  • Woozle: Supreme Uberwensch, general support, web hostess
  • Charlotte: tech support, apprentice in warp-drive arcana (aka Mastomaintenance)
  • ash: backend stuff, gay crimes

The Project: