March 6th: The Matrix

I spent a chunk of today cleaning up my room, which felt like a substantial morale boost, then thus emboldened tackled the performance issues of the particle system. What I found ended up really surprising me: What was slowing the system down as by and large not the drawing operations but, for some reason the color matrix creation operations. As best as I can tell, just creating small 20-value float arrays was, aggregated across several functions being called several times for each particles, just creating so much garbage that the garbage collector was triggering very frequently, each time costing 20+ms. To counteract this problem I went through all of the most frequently used functions and made them reuse static objects instead of allocating new ones, which is kind of an annoying thing to have to do but oh well. Even so, there are still spikes over the 16ms threshold I need to hit 60fps, but they’re less frequent and egregious now.

Advertisements

About problemmachine

What is the nature of your problem? Can we modify the nature of your problem? Can your problem be touched? Eaten? May we eat your problem for you? May we eat your soul for you? Would you like a replacement problem? We make problems. We eat souls. We crap solutions. We are Problem Machine.
This entry was posted in Daily Update, Programming. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s