mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-29 17:55:45 +01:00
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.