-
Notifications
You must be signed in to change notification settings - Fork 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
issue-109, benchmarks were improved #120
Conversation
79b278c
to
3895065
Compare
brro-compressor/benches/fft_bench.rs
Outdated
fn prepare_test_dir() -> PathBuf { | ||
let test_dir = tempfile::tempdir().unwrap().into_path(); | ||
fs::copy(TEST_WBRO_PATH, test_dir.join(TEST_FILE_NAME)).unwrap(); | ||
test_dir | ||
} | ||
|
||
/// Loads the file, decompresses it using fft_to_data, and returns the decompressed Vec<f64>. | ||
fn load_data_from_wbro_file() -> Vec<f64> { | ||
let test_dir = prepare_test_dir(); | ||
|
||
let test_file_path = test_dir.join(TEST_FILE_NAME); | ||
|
||
WavBrro::from_file(&test_file_path).unwrap() | ||
} |
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.
I believe prepare_test_dir
here is redundant because the benchmarks work only with f64 samples, not the wavbrro itself. So, you may just read the samples from it. Also, the comment doesn't fit the content. load_data_from_wbro_file
doesn't decompress the data, it only reads f64 samples from wavbrros.
fn prepare_test_dir() -> PathBuf { | |
let test_dir = tempfile::tempdir().unwrap().into_path(); | |
fs::copy(TEST_WBRO_PATH, test_dir.join(TEST_FILE_NAME)).unwrap(); | |
test_dir | |
} | |
/// Loads the file, decompresses it using fft_to_data, and returns the decompressed Vec<f64>. | |
fn load_data_from_wbro_file() -> Vec<f64> { | |
let test_dir = prepare_test_dir(); | |
let test_file_path = test_dir.join(TEST_FILE_NAME); | |
WavBrro::from_file(&test_file_path).unwrap() | |
} | |
/// Loads the file, decompresses it using fft_to_data, and returns the decompressed Vec<f64>. | |
fn load_data_from_wbro_file() -> Vec<f64> { | |
WavBrro::from_file(&test_file_path).unwrap() | |
} |
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.
Yeah, my bad, will be fixed
brro-compressor/benches/fft_bench.rs
Outdated
|
||
// Basic FFT compression benchmark | ||
/// Basic FFT compression benchmark with decompressed data |
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.
I think you should revert it because the data provided by load_data_from_wbro_file
is not decompressed
3895065
to
e8eed95
Compare
e8eed95
to
3a3537b
Compare
Benchmarks were improved by reading sample data from the real .wbro file
Closes #109