1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! Perf budget tests for the compile journal hot path.
//!
//! Issue #459: `JournalEntry::new` + `CompileJournal::log` together used to
//! cost ~2–4 µs on Windows (SystemTime::now + format_timestamp +
//! serde_json::to_string) and the client used to wait on that work before
//! `conn.send` returned. The fix reorders the daemon dispatch loop so the
//! response is sent first; these tests pin the per-call cost so a future
//! regression that adds more synchronous work to the hot path is caught.
//!
//! Budget is set ~10× looser than typical so transient CI noise doesn't
//! false-positive — the gate is "did someone accidentally add a syscall
//! or unbounded allocation per call", not micro-benchmarking.
use ;
use JournalEntry;
use make_ctx;
/// Building a `JournalEntry` should stay allocation-bounded. The old
/// implementation paid `SystemTime::now()` + a 24-byte `format!` heap alloc
/// per call. Any future change that adds a fresh syscall or string
/// allocation per call would push this past budget.