-
Notifications
You must be signed in to change notification settings - Fork 99
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
RTE-54: Memory Allocators Performance Testing #613
base: aj/update-sgx-alloc
Are you sure you want to change the base?
Conversation
BobbyAtFortanix
commented
Jun 5, 2024
- create: basic, hot & cold performance test (memory allocation)
- createde basic, hot & cold performance test (memory allocation)
|
||
|
||
use std::alloc::AllocError; | ||
//use std::env; |
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.
Clean up code that is not used.
static APP_NAME: &str = "mem-performance-test"; | ||
|
||
// Test Parameters | ||
// println!(" AllocFree: does alloc buf_size followed by free for n_sec"); |
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.
Remove call to println functions and only keep textual data as comments.
// println!(" AllocManyFreeManyWarm: silmilar to AllocManyFreeManyCold but it ignores the "); | ||
// println!(" first run and run each buf_size without restarting the application."); | ||
|
||
const POW: u32 = 3; // MIN_SIZE specified as power of 2. 8bytes = 2^3 |
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.
MIN_SIZE_POW seems like a better name for this constant
|
||
let size = buf_size / mem::size_of::<u64>(); | ||
|
||
// #[cfg(never)] |
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.
clean up unused code here and the rest of this file
|
||
// calculate n_loops per second | ||
let mut loops_per_sec: u32 = 0; | ||
for i in 1..100 { |
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.
100 can be defined as a test constant
if vec.capacity() < n_els { | ||
vec.reserve(n_els - vec.capacity()); | ||
} | ||
if vec.len() <= 0 { vec.clear(); } // j.i.c. - expected to be empty |
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.
What is j.i.c.?
return "!zero_after_alloc"; | ||
} | ||
|
||
fn main() { |
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.
Can you add some of the test results as a file in the examples/mem-perforamnce-test
directory so someone who runs the test in the future is aware of expected results?
You should target the PR to master branch and not aj/update-sgx-alloc. |