Skip to content

Commit

Permalink
Round memory test to nearest megabyte
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Jan 10, 2025
1 parent c1a109c commit c562d8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/store/re_chunk_store/tests/memory_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ fn scalar_memory_overhead() {
[
format!("{NUM_SCALARS} scalars"),
format!(
"{} in total",
re_format::format_bytes(total_mem_use_global as _)
"{} MiB in total",
(total_mem_use_global as f64 / 1024.0 / 1024.0).round() // Round to nearest megabyte - we get fluctuations on the kB depending on platform
),
format!(
"{} per row",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
source: crates/store/re_chunk_store/tests/memory_test.rs
assertion_line: 133
expression: "[format!(\"{NUM_SCALARS} scalars\"),\nformat!(\"{} in total\", re_format::format_bytes(total_mem_use_global as _)),\nformat!(\"{} per row\",\nre_format::format_bytes(total_mem_use_global as f64 / NUM_SCALARS as f64)),]"
expression: "[format!(\"{NUM_SCALARS} scalars\"),\nformat!(\"{} MiB in total\",\n(total_mem_use_global as f64 / 1024.0 / 1024.0).round()),\nformat!(\"{} per row\",\nre_format::format_bytes(total_mem_use_global as f64 / NUM_SCALARS as f64)),]"
snapshot_kind: text
---
[
"1048576 scalars",
"37.0 MiB in total",
"37 MiB in total",
"37 B per row",
]

0 comments on commit c562d8b

Please sign in to comment.