mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-23 18:21:13 +08:00
test: 分配性能测试放宽时间约束
This commit is contained in:
@@ -42,11 +42,18 @@ fn epoch_benchmark_1m_allocations() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let elapsed = start.elapsed();
|
let elapsed = start.elapsed();
|
||||||
assert!(
|
if cfg!(debug_assertions) {
|
||||||
elapsed.as_millis() < 100,
|
println!(
|
||||||
"1M allocations took {}ms, expected <100ms",
|
"1M allocations took {}ms (debug build - skipping timing assertion)",
|
||||||
elapsed.as_millis()
|
elapsed.as_millis()
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
assert!(
|
||||||
|
elapsed.as_millis() < 200,
|
||||||
|
"1M allocations took {}ms, expected <200ms",
|
||||||
|
elapsed.as_millis()
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user