Skip to content

Commit

Permalink
Add 8mb buffer for small files
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasAlaif committed Dec 17, 2024
1 parent 5ff4da8 commit e5aeb07
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions smt-log-parser/tests/parse_logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ fn parse_all_logs() {
let file_info = (file_size != parse_bytes)
.then(|| format!(" / {} MB", file_size / mb))
.unwrap_or_default();
let parse_bytes_ovhd = parse_bytes + 8 * mb;

// Gives 100 millis per MB (or 100 secs per GB)
let timeout = Duration::from_millis(parse_bytes / (10 * 1024) + 500);
Expand Down Expand Up @@ -83,7 +84,7 @@ fn parse_all_logs() {
parser.mem_dbg(DbgFlags::default()).ok();
// TODO: decrease this
assert!(
mem_size as u64 <= parse_bytes * 2,
mem_size as u64 <= parse_bytes_ovhd * 2,
"Parser takes up more memory than 2 * file size!"
);

Expand Down Expand Up @@ -134,7 +135,7 @@ fn parse_all_logs() {
// TODO: decrease this
assert!(elapsed_ml < timeout, "ML search took longer than timeout");
assert!(
mem_size as u64 <= parse_bytes * 5,
mem_size as u64 <= parse_bytes_ovhd * 5,
"Analysis takes up more memory than 5 * file size!"
);

Expand Down

0 comments on commit e5aeb07

Please sign in to comment.