Most of time the files are identical, so instead of comparing the TTX
dump we can check sha256 hashes of the files first and if they match, we
don’t have to check the TTX dumps at all, making the subset tests orders
of magnitude faster.
time meson test --suite=subset down from:
real 0m19.418s
user 0m38.171s
sys 0m3.587s
to:
real 0m3.102s
user 0m8.622s
sys 0m1.701s
The expected files have been replaced by hb-subset output so they are
bit-identical where FontTools output might not.
The generate-expected-outputs.py now compares the hb-subset output with
fontttols subset and errors of they don’t match.
time meson test --suite=subset down from:
real 0m22.822s
user 0m44.561s
sys 0m9.255s
to:
real 0m19.418s
user 0m38.171s
sys 0m3.587s
Does not seem to help much, but it is something.
Part of https://github.com/harfbuzz/harfbuzz/issues/3089
hb_object's user_data is created lazily. The previous implementation of
hb_object_set_user_data created space for the user_data but did not
actually construct it. This means that hb_user_data_array_t's lock was
not constructed. If hb_mutex_t is backed by an implementation which
requires that it be constructed (not just zero initialized) then errors
will occur when taking the lock when setting the user data.
Change hb_object_set_user_data to construct the user_data in the created
space and hb_object_fini to call the destructor.
Speed-up subset tests by saving TTX dump of expected output instead of
generating it each time the tests are run.
Cuts down meson test --suite=subset on my system from:
real 0m38.977s
user 1m12.024s
sys 0m10.547s
to:
real 0m22.291s
user 0m44.548s
sys 0m9.221s
Part of https://github.com/harfbuzz/harfbuzz/issues/3089
The test in question is the one added in c68a00b92e.
Culprit is that it's allocating lots of memory because of region_indices that
are out-of-range anyway. So, try to filter those out first.
Fixes https://github.com/harfbuzz/harfbuzz/issues/3017
Uses AdobeBlank2.ttf from:
https://github.com/adobe-fonts/adobe-blank-2
instead of a dummy empty font so that everything maps to GID 1 and
control code points are kept instead of being dropped because there is
not space glyph (otherwise we’d need to identify control code points
somehow when generating the expectations).
Currently COLRv1 spec is being changed so the subsetting implementation is out of sync. Disable subsetting by failing sanitization for COLRv1 tables and disable all colrv1 tests.