Closed jfkthame closed 1 year ago
:umbrella: The latest upstream changes (presumably #105) made this pull request unmergeable. Please resolve the merge conflicts.
I've updated this to take a different approach that (AFAICS) should not break any public API. @Manishearth PTAL and see if this is a workable way forward.
Current results on my local machine for cargo bench -F bench_it --bench udhr
with master:
test bench_1_bidi_info_new_for_ltr_texts ... bench: 672,764 ns/iter (+/- 94,785)
test bench_2_bidi_info_new_for_bidi_texts ... bench: 778,742 ns/iter (+/- 172,804)
test bench_3_reorder_line_for_ltr_texts ... bench: 110,351 ns/iter (+/- 6,317)
test bench_4_reorder_line_for_bidi_texts ... bench: 255,082 ns/iter (+/- 25,808)
Same test with this patch:
test bench_1_bidi_info_new_for_ltr_texts ... bench: 215,393 ns/iter (+/- 23,973)
test bench_2_bidi_info_new_for_bidi_texts ... bench: 725,057 ns/iter (+/- 55,314)
test bench_3_reorder_line_for_ltr_texts ... bench: 8,326 ns/iter (+/- 1,408)
test bench_4_reorder_line_for_bidi_texts ... bench: 193,079 ns/iter (+/- 14,852)
So we get a pretty big improvement on the ltr_texts
tests, and also a slight improvement on the bidi_texts
ones (presumably the "bidi" texts do have a smattering of LTR-only paragraphs in them).
Needs rustfmt, you can ignore the failure on 1.36 (I should fix that CI job)
I'll just merge and fix in post.
Thanks!!
This aims to boost performance for paragraphs that do not contain any strongly-RTL characters.
Typical results of
cargo bench -F bench_it --bench udhr
with current master:And the same test after applying this patch: