I’ve been having an issue with my program running slow at points where
it really just shouldn’t. I’ve finally determined (I think) that the
culprit is actually garbage collection being called.
I want to have more control over GC. However, the problem is, I suspect
that later on it could take 1 second or longer each time it runs, and I
can’t have my program being blocked for that long. One option is that I
could put GC in a separate thread (I haven’t tested whether this will
cause stability issues). Another, I wondered, is whether or not GC
could be called in a fiber somehow so that its execution load can be
stretched out over 5 seconds or so as I deem appropriate?
Other things I’ll be doing will be seeing if I can find ways to reduce
the number of objects I am creating, but I suspect that I will need to
look at the above kinds of improvements even after this.