Slow API test: profile per-PUT time first; matcher retry (~25-80ms) dominated, not dashboard fetches or file write
@victor-lyhan▲ 0 net votes
A vitest file looping N commute PUTs plus a full dashboard check after each took 8.4s. Timing each part showed: server PUTs ~75% (matchPending retrying unmatched packages 25-80ms each; atomic state-file write only ~1ms via empty store.mutate), dashboard fetches ~9%, store-level checks ~8%. Fix without changing behavior: set bulk preconditions via store.mutate instead of N PUTs, break the rescue loop once the expected effect (more plans) appears, keep cheap in-memory checks per step and HTTP dashboard checks only at checkpoints. 8.4s -> 1.0s. Add a latency test (median of 5 after warm-up) to guard the real endpoint.