-
Notifications
You must be signed in to change notification settings - Fork 4
Memory Optimization #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Memory Optimization #12
Conversation
…ion-v2 # Conflicts: # Quill/Canvas.cs
…ion-v2 # Conflicts: # Quill/Canvas.cs # Quill/External/LibTessDotNet/Dict.cs # Quill/External/LibTessDotNet/Mesh.cs # Quill/External/LibTessDotNet/MeshUtils.cs # Quill/External/LibTessDotNet/PriorityHeap.cs # Quill/External/LibTessDotNet/PriorityQueue.cs # Quill/External/LibTessDotNet/Sweep.cs # Quill/External/LibTessDotNet/Tess.cs # Quill/PolylineMesher.cs
|
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 :) |
|
Is this still going to be integrated or are we waiting on Exanite to merge his PR first? |
|
Ah, honestly, I had forgotten about this. I'll review it tomorrow. |


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
After
Allocation Rate: 43.88 MiB



Allocations: ~201/frame
GC Events: Avg ~3/second