-
Notifications
You must be signed in to change notification settings - Fork 0
perf improve #364
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
perf improve #364
Conversation
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.
The memory implementation has been significantly refactored for performance, primarily by replacing dictionary-based page lookups with a bitmask implementation and using unsafe memory operations for faster data handling. While the changes are generally positive for performance, a potential memory safety issue has been introduced in StandardMemory where a read can go out of bounds. Additionally, a piece of logic in GeneralMemory for updating memory chunks was made more complex and less efficient than its previous implementation.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #364 +/- ##
==========================================
- Coverage 81.68% 81.66% -0.02%
==========================================
Files 378 381 +3
Lines 33362 33572 +210
==========================================
+ Hits 27251 27416 +165
- Misses 6111 6156 +45 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
No issues found |
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.
The changes introduce significant performance improvements across memory management, instruction caching, and register access by using more direct memory manipulation (e.g., memcpy, bitfields, pointer arithmetic) and reducing overhead from data structures. However, there is a potential integer overflow bug in the new PageMap implementation when searching for free memory pages.
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.
The pull request introduces significant performance improvements, primarily by refactoring the memory management system in PolkaVM. The changes include replacing dictionary-based page tracking with a more efficient bitmask implementation, utilizing memcpy and memset for faster memory operations, and removing the LRUCache dependency. Additional performance gains are achieved by optimizing dictionary capacity reservations and reusing an expensive DateFormatter object. One minor code redundancy was found.
|
No issues found |
~2x speed improve