Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

benchmark against ttf-parser #2510

Merged
merged 1 commit into from
Jul 30, 2020
Merged

Conversation

ebraminio
Copy link
Collaborator

@ebraminio ebraminio commented Jun 28, 2020

# first install rustc from your package manager, if you have it from rustup or anything well that's even better
meson build -Dexperimental_api=true -Doptimization=2
ninja -Cbuild
build/perf/perf

ttf-parser's extents calculates costly for variable font's when there is no actual coordinates so needs some tweaks, RazrFalcon/ttf-parser#28 and RazrFalcon/ttf-parser#27 to become comparable, it is still comparable when coordinate are given (/vf cases) and specially in CFF/CFF2

rustybuzz is a gradual port of harfbuzz to rust https://github.com/RazrFalcon/rustybuzz that now doesn't have glyph related part of our font parsing logics still runs our test suite thanks to ttf-parser.

things can be improved on ot-draw if path command 'sanitization' be removed.

picked up from https://circleci.com/gh/harfbuzz/harfbuzz/146188 "build/perf/perf && rm -rf build" section

---------------------------------------------------------------------------------------
Benchmark                                                Time           CPU Iterations
---------------------------------------------------------------------------------------
shape/fa-thelittleprince.txt - Amiri             122202682 ns  122183608 ns          5
shape/fa-thelittleprince.txt - NotoNastaliqUrdu  423983455 ns  423303848 ns          2
shape/fa-monologue.txt - Amiri                    20740165 ns   20382469 ns         34
shape/fa-monologue.txt - NotoNastaliqUrdu         74148273 ns   72333353 ns         10
shape/en-thelittleprince.txt - Roboto             64665055 ns   64377800 ns         10
shape/en-words.txt - Roboto                       75118780 ns   75024550 ns          8
extents/cff - ot - SourceSansPro                   5066222 ns    5064483 ns        134
extents/cff - ft - SourceSansPro                  11262572 ns   11232289 ns         66
extents/cff - tp - SourceSansPro                   2393903 ns    2393362 ns        292
extents/cff2 - ot - AdobeVFPrototype               5247237 ns    5206772 ns        132
extents/cff2 - ft - AdobeVFPrototype               3980850 ns    3979831 ns        179
extents/cff2 - tp - AdobeVFPrototype               2057811 ns    2057536 ns        346
extents/cff2/vf - ot - AdobeVFPrototype            5376816 ns    5299965 ns        100
extents/cff2/vf - ft - AdobeVFPrototype            4078521 ns    4074512 ns        172
extents/cff2/vf - tp - AdobeVFPrototype            2067422 ns    2041259 ns        350
extents/glyf - ot - SourceSerifVariable              50883 ns      50699 ns      12265
extents/glyf - ft - SourceSerifVariable            1663266 ns    1643066 ns        414
extents/glyf - tp - SourceSerifVariable            3873030 ns    3871871 ns        185
extents/glyf/vf - ot - SourceSerifVariable         6347738 ns    6312792 ns        108
extents/glyf/vf - ft - SourceSerifVariable         5716778 ns    5708774 ns        125
extents/glyf/vf - tp - SourceSerifVariable         6615693 ns    6532585 ns        122
extents/glyf - ot - Comfortaa                        33474 ns      33208 ns      21543
extents/glyf - ft - Comfortaa                       984342 ns     979308 ns        752
extents/glyf - tp - Comfortaa                      2399276 ns    2359676 ns        296
extents/glyf/vf - ot - Comfortaa                   3891430 ns    3889872 ns        177
extents/glyf/vf - ft - Comfortaa                   3316384 ns    3312605 ns        222
extents/glyf/vf - tp - Comfortaa                   4251239 ns    4243509 ns        164
extents/glyf - ot - Roboto                           45450 ns      45394 ns      15424
extents/glyf - ft - Roboto                         1166475 ns    1160516 ns        589
extents/glyf - tp - Roboto                           32090 ns      31966 ns      21862
draw/cff - ot - SourceSansPro                      6382060 ns    6381087 ns        103
draw/cff - ft - SourceSansPro                     11149430 ns   11136182 ns         61
draw/cff - tp - SourceSansPro                      2473528 ns    2458573 ns        288
draw/cff2 - ot - AdobeVFPrototype                  5159724 ns    5132608 ns        131
draw/cff2 - ft - AdobeVFPrototype                  3943370 ns    3920704 ns        180
draw/cff2 - tp - AdobeVFPrototype                  2059765 ns    2047303 ns        335
draw/cff2/vf - ot - AdobeVFPrototype               5527324 ns    5501692 ns        127
draw/cff2/vf - ft - AdobeVFPrototype               4111966 ns    4111240 ns        172
draw/cff2/vf - tp - AdobeVFPrototype               2077378 ns    2074750 ns        338
draw/glyf - ot - SourceSerifVariable               4443270 ns    4442628 ns        155
draw/glyf - ft - SourceSerifVariable               1629466 ns    1629228 ns        434
draw/glyf - tp - SourceSerifVariable               3906841 ns    3906258 ns        177
draw/glyf/vf - ot - SourceSerifVariable            8061347 ns    7959191 ns         84
draw/glyf/vf - ft - SourceSerifVariable            5451965 ns    5450260 ns        125
draw/glyf/vf - tp - SourceSerifVariable            6299210 ns    6265153 ns        105
draw/glyf - ot - Comfortaa                         2722454 ns    2722034 ns        257
draw/glyf - ft - Comfortaa                          977256 ns     960065 ns        719
draw/glyf - tp - Comfortaa                         2398904 ns    2396771 ns        278
draw/glyf/vf - ot - Comfortaa                      5024540 ns    5023935 ns        100
draw/glyf/vf - ft - Comfortaa                      3331846 ns    3290786 ns        207
draw/glyf/vf - tp - Comfortaa                      4346116 ns    4319098 ns        166
draw/glyf - ot - Roboto                            2602575 ns    2596758 ns        269
draw/glyf - ft - Roboto                            1144549 ns    1143878 ns        609
draw/glyf - tp - Roboto                            1243036 ns    1240433 ns        555

@ebraminio ebraminio force-pushed the perf-rust branch 3 times, most recently from e096965 to 98e04a8 Compare June 28, 2020 10:52
@ebraminio ebraminio changed the title [WIP] benchmark against ttf-parser benchmark against ttf-parser Jun 28, 2020
@ebraminio ebraminio force-pushed the perf-rust branch 4 times, most recently from b02a6d0 to 2e49be7 Compare June 28, 2020 11:44
@ebraminio ebraminio marked this pull request as draft June 28, 2020 15:57
@ebraminio ebraminio force-pushed the perf-rust branch 2 times, most recently from 3422c18 to ef1dfd7 Compare July 1, 2020 10:28
@ebraminio
Copy link
Collaborator Author

ebraminio commented Jul 2, 2020

let's close till we agree on benchmarking needs and so and c-api becomes a no_std also, otherwise can be considered useful I guess.

@ebraminio ebraminio closed this Jul 2, 2020
@behdad
Copy link
Member

behdad commented Jul 2, 2020

What column is which? This is very bad way to present perf results. I know we follow up and fix in the other issue. Just saying. :-)

c-api becomes a no_std also

Huh?

@ebraminio ebraminio deleted the perf-rust branch July 2, 2020 18:41
@ebraminio
Copy link
Collaborator Author

c-api becomes a no_std also
Huh?

Oh, c-api wrapper of ttf-parser has dependency to Rust's standard library as RazrFalcon/ttf-parser#29 however ttf-parser's Rust core doesn't need Rust's standard library unlike its c wrapper which can be fixed.

@ebraminio
Copy link
Collaborator Author

What column is which? This is very bad way to present perf results. I know we follow up and fix in the other issue. Just saying. :-)

Absolutely! Feel free to give me feedback on it! Even better, having a look at its source https://github.com/harfbuzz/harfbuzz/blob/master/perf/perf-extents.hh#L43-L65

@ebraminio ebraminio restored the perf-rust branch July 29, 2020 07:50
@ebraminio ebraminio reopened this Jul 29, 2020
@ebraminio ebraminio marked this pull request as ready for review July 29, 2020 07:51
@ebraminio ebraminio merged commit 5f9ff04 into harfbuzz:master Jul 30, 2020
@ebraminio ebraminio deleted the perf-rust branch July 30, 2020 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants