Files
craft-libs/crates/affinity/tests
dotCooCoo a2eab0d9f3 .af reader: the paragraph matching test counts lookups instead of timing
many_paragraphs_and_runs_are_matched_in_about_linear_time passed only
when a story of 200,000 paragraphs and runs opened within 10 s. A
counter, built with the synth feature that the test already needs, now
records each paragraph end story_runs looks up to give a run its
paragraph's format, and synth::count_paragraph_lookups returns it for
one call. The test opens the story at 50,000 and at 200,000 paragraphs
and checks that the larger one takes at most five times the lookups.
With the paragraph found by a scan instead of a binary search, the
lookups grow from 1,251,725,000 to 20,007,700,000 and the test fails.
2026-11-27 20:09:31 -08:00
..