servo / unicode-bidi

Implementation of the Unicode Bidirection Algorithm in Rust
Other
77 stars 33 forks source link

Add benchmark and character conformance tests #33

Closed behnam closed 7 years ago

behnam commented 7 years ago

Add benchmark tests using UDHR text files

The bench functions are put in two groups: for_ltr_texts and for_bidi_texts. This will allow us measure improvements for both all-LTR and bidirectional situations.

Current results:

test bench_bidi_info_new_and_reordered_for_bidi_texts ... bench: 9,711,485 ns/iter (+/- 917,086)
test bench_bidi_info_new_and_reordered_for_ltr_texts  ... bench: 6,496,454 ns/iter (+/- 829,583)
test bench_bidi_info_new_for_bidi_texts               ... bench: 9,813,185 ns/iter (+/- 1,180,446)
test bench_bidi_info_new_for_ltr_texts                ... bench: 6,811,823 ns/iter (+/- 1,079,303)

[tests] Add test_character_conformance() and some cleanup


This change is Reviewable

behnam commented 7 years ago

Finally got the nightly bench working on travis! The trick is that have to create an unstable branch, to be used by travis-cargo, and it's an error to not have one in Cargo.toml.

test bench_bidi_info_new_and_reordered_for_bidi_texts ... bench:  12,569,450 ns/iter (+/- 913,045)
test bench_bidi_info_new_and_reordered_for_ltr_texts  ... bench:   8,172,522 ns/iter (+/- 81,493)
test bench_bidi_info_new_for_bidi_texts               ... bench:  12,488,570 ns/iter (+/- 238,099)
test bench_bidi_info_new_for_ltr_texts                ... bench:   8,339,091 ns/iter (+/- 780,304)
mbrubeck commented 7 years ago

@bors-servo r+

bors-servo commented 7 years ago

:pushpin: Commit 54cb4d9 has been approved by mbrubeck

bors-servo commented 7 years ago

:hourglass: Testing commit 54cb4d932fa13889e7b07c7088373007af3f0e70 with merge 019b6712e5c837aadb3fb97ebfe2eb75a0a9e5c1...

bors-servo commented 7 years ago

:sunny: Test successful - status-travis Approved by: mbrubeck Pushing 019b6712e5c837aadb3fb97ebfe2eb75a0a9e5c1 to master...