Skip to content

Conversation

@MiniMe453
Copy link

@MiniMe453 MiniMe453 commented Sep 13, 2025

I noticed that there was a lot of GC going on, so I went through the code base and did a lot of optimizations. Everything should be working exactly the same as before, just with much better memory usage.

There are a lot of changes here, and it's possible that I may have misunderstood some important aspects of the code. Functionally, the output is the same, so I think that it's okay, but it needs to be checked just in case.

Before

Allocation Rate: 995 MiB
Allocations: ~3327/frame
GC Events: Avg ~300/second
image
image
image

After

Allocation Rate: 43.88 MiB
Allocations: ~201/frame
GC Events: Avg ~3/second
image
image
image

@michaelsakharov
Copy link
Contributor

Thanks for this! Just started reviewing it, found an exception, if you open the demo and press an arrow key to shift to the other demo's the SVG Demo throws an exception in Mesh.cs.

image image

@MiniMe453 MiniMe453 marked this pull request as draft September 16, 2025 18:47
@MiniMe453
Copy link
Author

MiniMe453 commented Sep 27, 2025

In order to fix everything, I just restarted from scratch. The performance improvement is not quite as high (only ~200-300 fps instead of ~300-400 fps), but the GC pressure seems to be reduced. It works with all of the examples provided in the canvas demo as well, so that is also a big improvement.

I only need to implement support for .NET 2.1 now, and it's good for another review :)

@MiniMe453 MiniMe453 marked this pull request as ready for review September 27, 2025 00:33
@MiniMe453 MiniMe453 marked this pull request as draft September 27, 2025 00:35
@PaperPrototype
Copy link

Is this still going to be integrated or are we waiting on Exanite to merge his PR first?

@michaelsakharov
Copy link
Contributor

Ah, honestly, I had forgotten about this. I'll review it tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants