-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/mem optimization v2 #1
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: master
Are you sure you want to change the base?
Feature/mem optimization v2 #1
Conversation
The structs were already being allocated to the heap, but as a struct, the object pool wasn't working correctly, so it was still allocating to the heap. By changing it to a class, it fixes this issue.
did some more work and now the library is extremely performant. Final resultsAllocation Rate: 6.53 MiB :D I just need to fix a memory leak related to the |
Is this ready or still a draft? |
@michaelsakharov I fixed the memory leak issue with TextLayoutSettings :) it seems it was an issue with using stack to pool the objects, so i changed it to a list and explicit index. seems to work very well now and the GC pressure is even lower in markdown mode. this PR is ready for review! |
} | ||
|
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a mismatched bracket here
The goal is to reduce the number of allocations in Scribe to increase the performance. I am creating this pull request so others can look at the code and help with the optimization. Outcome is a 99% reduction in the allocation rate and 99% decrease in the number of GC events
Using Markdown layout system
Before
Allocation Rate: 864 MiB


GC Count: ~71/frame
After
Allocation Rate: 6.53 MiB


Allocations/Frame: ~38/frame
GC Count: <1/second
The markdown demo is by far the most demanding on the system. For the other demos, just rendering text is now extremely fast
Before
After