Skip to content
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

Open
wants to merge 1 commit into
base: aj/update-sgx-alloc
Choose a base branch
from

Conversation

BobbyAtFortanix
Copy link

  • create: basic, hot & cold performance test (memory allocation)

- createde basic, hot & cold performance test (memory allocation)
@aditijannu aditijannu requested review from raoulstrackx and removed request for nshyrei June 25, 2024 09:26


use std::alloc::AllocError;
//use std::env;

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");

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

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)]

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 {

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

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() {

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?

@aditijannu
Copy link

You should target the PR to master branch and not aj/update-sgx-alloc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants