-
Notifications
You must be signed in to change notification settings - Fork 370
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
Feat/fixed chunk alloc by class #1960
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1960 +/- ##
==========================================
+ Coverage 84.87% 85.14% +0.27%
==========================================
Files 797 810 +13
Lines 95082 99853 +4771
==========================================
+ Hits 80697 85022 +4325
- Misses 14385 14831 +446 ☔ View full report in Codecov by Sentry. |
//if self.recently_allocated_size > (0.8 * self.max_chunk_size as f64) as usize { | ||
// self.extend_max_memory(storage); | ||
// self.recently_added_chunks = Vec::new(); | ||
// self.recently_allocated_size = 0; | ||
//} |
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.
Dead code
@@ -371,6 +397,7 @@ impl MemoryPool { | |||
) -> ChunkHandle { | |||
let padding = calculate_padding(size); | |||
let effective_size = size + padding; | |||
//let effective_size = self.max_chunk_size; |
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.
dead code
Pull Request Template
Checklist
run-checks all
script has been executed.Related Issues/PRs
Provide links to relevant issues and dependent PRs.
#1752
Changes
Added sizes classes in memory management. If an allocation is asked for that is under the class threshold, that class threshold will be allocated. This is so that when we alloc bigger and bigger slices, we are stilll able to reuse. I.E if I ask 128mb, 150mb then 170mb, I'm still able to reuse allocations without having to realloc. Also recoded extend max memory to work. It's not currently being used due to computation being slow after being used. However it was tested for correctness.
Summarize the problem being addressed and your solution.
Testing
Tested against simple mm on Text-classification ag-news-training on release mode and saw 60% speedup improvement