Behdad Esfahbod
32dd9810cf
[subset-cff1] Cache glyph-to-sid-map in the accelerator
...
Benchmark Time CPU Time Old Time New CPU Old CPU New
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/10 -0.0841 -0.0843 0 0 0 0
BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/64 -0.1305 -0.1305 0 0 0 0
BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/512 -0.1398 -0.1401 1 1 1 1
BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/4096 +0.0382 +0.0380 9 9 9 9
BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/10000 +0.0213 +0.0211 11 11 11 11
2022-11-30 14:00:33 -07:00
Behdad Esfahbod
72fabef0a4
[SingleSubstFormat2] Speed up closure
2022-11-30 11:37:49 -07:00
Behdad Esfahbod
2dc2e016d4
[cff] Enable an unlikely
2022-11-30 11:25:50 -07:00
Behdad Esfahbod
582a87ef0a
[cff] Speed up FDSelect0 sanitize
2022-11-30 11:20:19 -07:00
Garret Rieger
2658370f00
[subset] make the cmap cache in accelerator const.
2022-11-29 22:04:10 -07:00
Garret Rieger
7551a668e3
[subset] Make cff_accelerator const.
...
This gives more confidence that it won't be accidentally modified by the subset operation using it.
2022-11-29 22:04:10 -07:00
Behdad Esfahbod
d8d0e06694
[array] Comment
2022-11-29 21:35:54 -07:00
Behdad Esfahbod
2fecf2aa19
[ClassDef] Minor rename
2022-11-29 21:25:01 -07:00
Behdad Esfahbod
8f632ca884
[ClassDef] Write another loop as range for
2022-11-29 21:23:35 -07:00
Behdad Esfahbod
87b12aee13
[ClassDef] Write a couple loops as range for
2022-11-29 21:18:48 -07:00
Behdad Esfahbod
ccd40c842c
[ClassDef] Optimize intersected_class_glyphs
2022-11-29 21:15:19 -07:00
Behdad Esfahbod
44c585a6df
[ClassDef] Fix disabled codeblock
2022-11-29 20:52:48 -07:00
Behdad Esfahbod
9b7617d433
[ClassDef2] Use a faster algorithm in subset()
...
Speedup across the board; up to 40% for MPlus1 at small sizes.
2022-11-29 20:29:58 -07:00
Behdad Esfahbod
ae5e6d562b
[ClassDef2] Micro-optimize
2022-11-29 15:48:38 -07:00
Behdad Esfahbod
7129b79406
[open-type] Add faster range-based loop to array types
2022-11-29 15:33:07 -07:00
Behdad Esfahbod
dc82334061
Remove a couple of unneeded .iter() invocations
2022-11-29 15:26:55 -07:00
Behdad Esfahbod
00f2657bb8
[subset] Accelerate sanitize-table-cache
...
Big wins all across small subsets
BM_subset/subset_codepoints/Roboto-Regular.ttf/nohinting/10 -0.1140 -0.1129 0 0 0 0
BM_subset/subset_codepoints/Amiri-Regular.ttf/nohinting/10 -0.4717 -0.4714 0 0 0 0
BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/10 -0.8147 -0.8146 0 0 0 0
BM_subset/subset_codepoints/NotoSansDevanagari-Regular.ttf/nohinting/10 -0.3248 -0.3242 0 0 0 0
BM_subset/subset_codepoints/Mplus1p-Regular.ttf/nohinting/10 -0.1262 -0.1260 0 0 0 0
BM_subset/subset_codepoints/SourceHanSans-Regular_subset.otf/nohinting/10 -0.0308 -0.0309 0 0 0 0
BM_subset/subset_codepoints/SourceSansPro-Regular.otf/nohinting/10 -0.1374 -0.1373 0 0 0 0
BM_subset/subset_codepoints/AdobeVFPrototype.otf/nohinting/10 -0.4555 -0.4555 0 0 0 0
BM_subset/subset_codepoints/MPLUS1-Variable.ttf/nohinting/10 -0.4175 -0.4174 0 0 0 0
BM_subset/subset_codepoints/RobotoFlex-Variable.ttf/nohinting/10 -0.4214 -0.4214 0 0 0
2022-11-29 15:20:13 -07:00
Behdad Esfahbod
33165f4848
[bit-page] Remove ELT_BITS_LOG_2
...
My compiler is smart enough to take care of it.
2022-11-29 15:15:43 -07:00
Garret Rieger
7a004a7ac2
[subset] Cache per subtable cmap unicode mappings.
2022-11-28 19:48:15 -07:00
Behdad Esfahbod
d2a2670e54
[iter] Simplify has() interface implementations
2022-11-28 19:43:09 -07:00
Behdad Esfahbod
cba82829ba
[subset-cff1] Share subrs object
...
Multiple FDs might share the same subrs...
2022-11-28 16:19:54 -07:00
Behdad Esfahbod
c7b998b355
[cff2] Don't share fd-array link
...
No point.
2022-11-28 16:18:21 -07:00
Behdad Esfahbod
3d9e3c2dc7
[subset-cff2] Don't share varstore object
2022-11-28 16:17:09 -07:00
Behdad Esfahbod
c503cf003e
[cmap] Store offset, not pointer, in cmap cache
2022-11-28 15:53:35 -07:00
Behdad Esfahbod
3e151139a8
[PairPos] Optimize get_effective_value_format
...
Speeds up BM_subset/subset_glyphs/SourceHanSans-Regular_subset.otf/nohinting/512
12%.
2022-11-28 14:23:49 -07:00
Behdad Esfahbod
3131aecf9f
[array/hash] Fix asan issue
...
../src/hb-algs.hh:240:43: runtime error: reference binding to misaligned address 0x7ffe91a08b0e for type 'const unsigned int', which requires 4 byte alignment
2022-11-28 14:12:55 -07:00
Behdad Esfahbod
26ad7a6022
[gpos] Minor micro-optimize
2022-11-28 14:12:52 -07:00
Behdad Esfahbod
c769d7e181
[gpos] Whitespace
2022-11-28 14:03:58 -07:00
Behdad Esfahbod
3ea0f37c30
[subset-cff] Move an init to constructor
...
The init was not called anyway.
2022-11-28 13:58:44 -07:00
Behdad Esfahbod
6c92c3e0cf
[subset-cff] Remove unnecessary check
2022-11-28 13:54:24 -07:00
Behdad Esfahbod
7fd300dd9a
[subset-cff] Use constructor for parsed_cs_op_t
2022-11-28 13:51:16 -07:00
Garret Rieger
bd37900e0d
[subset] use a reference to cached global/loca subrs.
...
Previously they were being copied in. Copying is no longer necessary now that hint dropping doesn't mutate the arrays.
2022-11-28 13:43:52 -07:00
Behdad Esfahbod
ded9de9cd8
[cff] bsearch in fdselect
...
Saves 8% in NotoSansCJK / 10000 subset benchmark.
2022-11-28 13:32:08 -07:00
Behdad Esfahbod
0c33aba30c
[subset-cff] Rename drop flag to hinting flag
2022-11-28 12:28:13 -07:00
Behdad Esfahbod
6f5b531986
[subset-cff] Make no-hinting use accelerator as well
2022-11-28 12:24:29 -07:00
Behdad Esfahbod
f51a624e67
[subset-cff] Micro-optimize drop_hints_in_str
2022-11-27 14:54:39 -07:00
Behdad Esfahbod
3860326688
[subset-cff] Write loop more idiomatic
2022-11-27 13:23:13 -07:00
Behdad Esfahbod
3ff502d3ae
[subset-cff] Remove unnecessary initialization
2022-11-27 12:58:04 -07:00
Behdad Esfahbod
6af4985bf9
[subset-cff] No need for bitflag here anymore
2022-11-26 18:20:20 -07:00
Behdad Esfahbod
69ce606d14
[subset-cff] Immediately drop subr numbers instead of marking for skip
...
Seems to work and saves ~2% time.
2022-11-26 18:18:35 -07:00
Behdad Esfahbod
1cf4f3e083
[subset-cff] More comment
2022-11-26 18:15:28 -07:00
Behdad Esfahbod
f68221ff43
[subset-cff] Add comment
2022-11-26 18:12:14 -07:00
Behdad Esfahbod
048ab8a066
[subset-cff] Remove unused bits
2022-11-26 18:00:43 -07:00
Behdad Esfahbod
37cbfc0c7e
[subset-cff] Remove unneeded member
2022-11-26 17:57:44 -07:00
Behdad Esfahbod
46ab15137b
[subset-cff] Add has_calls to parsed charstrings
...
Optimize closure based on it.
2022-11-26 17:49:21 -07:00
Behdad Esfahbod
6d53074e63
[subset-cff] Drop another unused parameter
2022-11-26 17:23:09 -07:00
Behdad Esfahbod
42615561b5
Optimize a couple array references
2022-11-26 17:13:20 -07:00
Behdad Esfahbod
04d23b7ca8
[subset-cff] Micro-optimize collect_subr_refs_in_str
2022-11-26 17:08:00 -07:00
Behdad Esfahbod
9d18180c3c
[array] Use hb_hash instead of handrolling
2022-11-26 15:38:21 -07:00
Behdad Esfahbod
e302b9d5da
Fix build
2022-11-26 15:18:16 -07:00
Behdad Esfahbod
70d97d079b
[subset-cff] Remove unused argument
2022-11-26 15:16:11 -07:00
Behdad Esfahbod
4167e93a15
[subset-cff2] Micro-optimize blend operator
2022-11-26 15:14:52 -07:00
Behdad Esfahbod
f159bf075b
[cff2] Micro-optimize blend operator
2022-11-26 15:11:32 -07:00
Behdad Esfahbod
a331e913dc
[bit-page] Hand-code equality
...
Faster than memcmp() because of alignment.
2022-11-26 14:59:37 -07:00
Behdad Esfahbod
9df06a2695
[bit-set] Fix is_subset() short-circut criteria
...
Ouch!
2022-11-26 14:56:45 -07:00
Behdad Esfahbod
915c1a00cf
[vector] Add remove_unordered
...
Saves 5% in NotoNastaliq/1000 subset benchmark.
2022-11-26 14:48:57 -07:00
Behdad Esfahbod
4b8d8fbee4
[ot-map] Micro-optimize for size
2022-11-26 14:31:15 -07:00
Behdad Esfahbod
93f3a9dbc6
[ot-map] Micro-optimize more
...
Another 500 bytes.
2022-11-26 14:25:21 -07:00
Behdad Esfahbod
f39f049870
[ot-map] Micro-optimize
...
Weird that shrinks size by 500 bytes.
2022-11-26 14:16:15 -07:00
Behdad Esfahbod
60bb32c454
[ot-map] Minor refactor
2022-11-26 14:12:57 -07:00
Behdad Esfahbod
e3cc61838f
[PairPos] Adjust kerning buffer messages
2022-11-26 13:58:04 -07:00
Behdad Esfahbod
a81dd1053d
[layout] Adjust printing feature tags
...
For required-feature, print spaces, not nul bytes.
2022-11-26 13:43:36 -07:00
Behdad Esfahbod
56e3868b52
[layout/buffer-message] Print feature name in lookup buffer messages
2022-11-26 13:14:23 -07:00
Garret Rieger
a5d35fd80a
[subset] use charstrings directly from accelerator cache if mutability isn't needed.
2022-11-25 16:50:55 -07:00
Behdad Esfahbod
026b64ef76
[subset-cff] Avoid set mallocation in hb_plan_subset_cff_fdselect
2022-11-25 14:57:40 -07:00
Behdad Esfahbod
74acf52f33
[subset-cff] Micro-optimize copy_str more
2022-11-25 14:43:44 -07:00
Behdad Esfahbod
d2f3cde7ef
[subset-cff] Micro-optimize copy_str
2022-11-25 14:38:30 -07:00
Behdad Esfahbod
e333223f26
[array] Optimize serializing copy()
2022-11-25 14:26:02 -07:00
Behdad Esfahbod
22990fca1d
Merge pull request #3894 from googlefonts/cff_accel
...
[subset] Cache parsed char strings in CFF accelerator
2022-11-25 14:12:58 -07:00
Garret Rieger
8d5c899b0f
[subset] In cff accelerator hold reference to CFF table instead of the whole font.
2022-11-25 20:53:20 +00:00
Behdad Esfahbod
7b197446ac
[vector] Adjust for HB_OPTIMIZE_SIZE
2022-11-25 13:28:53 -07:00
Garret Rieger
75a99f28ab
[subset] destruct cff accelerator if present.
2022-11-25 20:24:05 +00:00
Behdad Esfahbod
1d474194f0
[subset-cff] Micro-optimize encode_str
2022-11-25 13:21:35 -07:00
Behdad Esfahbod
3c4a610b59
[subset-cff] Micro-optimize copy_str some more
2022-11-25 13:16:30 -07:00
Behdad Esfahbod
535aadb309
[subset-cff] Micro-optimize collect_subr_refs_in_str more
2022-11-25 13:07:42 -07:00
Behdad Esfahbod
00a9df3a43
[subset-cff] Micro-optimize collect_subr_refs_in_str
2022-11-25 13:05:05 -07:00
Behdad Esfahbod
d2a2f5bf4e
[vector] Handroll copy
2022-11-25 12:44:02 -07:00
Behdad Esfahbod
1fed366d5b
[serialize] Shut compiler warning off
2022-11-25 12:37:24 -07:00
Behdad Esfahbod
f2297e6978
[buffer] Documentation
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3889
2022-11-25 11:33:00 -07:00
Garret Rieger
71c23c1c07
[subset] don't copy the entire global/loca subr lists from the accelerator.
...
Instead run a closure on the retained charstrings and copy only the referenced subrs. This significantly speeds up cases with small character sets.
2022-11-25 18:05:39 +00:00
Garret Rieger
4ff09274a8
[subset] In CFF accelerator keep a reference to original face.
...
The charstring objects reference memory from the original face so we need to maintain a reference to prevent it from being destroyed.
2022-11-24 22:47:29 +00:00
Behdad Esfahbod
6aaa16627c
[Coverage] Comment
2022-11-24 14:58:42 -07:00
Behdad Esfahbod
06e2147a48
More call set->next() directly
2022-11-24 14:56:04 -07:00
Behdad Esfahbod
196c9db06f
Call ->next() directly
2022-11-24 14:51:52 -07:00
Behdad Esfahbod
03d64b7469
[bit-set] Remove TODO that would never happen
2022-11-24 14:33:18 -07:00
Behdad Esfahbod
690df8a369
[bit-set] Micro-optimize prev()
2022-11-24 14:32:51 -07:00
Behdad Esfahbod
fe5d9176ae
[bit-set] Micro-optimize size
...
It's silly that this saves size at all. :(
2022-11-24 14:30:18 -07:00
Behdad Esfahbod
cf9b9929df
[bit-set] Micro-optimize process()
2022-11-24 14:26:28 -07:00
Behdad Esfahbod
d77903db7b
[bit-set] Micro-optimize
2022-11-24 14:22:32 -07:00
Behdad Esfahbod
13dd4b464b
[bit-set] Micro-optimize access
2022-11-24 14:20:42 -07:00
Garret Rieger
a3afa61ce8
[subset] use cached parsed char strings if available.
2022-11-24 21:14:00 +00:00
Garret Rieger
47c125845c
[subset] Cache parsed charstrings in the cff accelerator.
2022-11-24 21:14:00 +00:00
Garret Rieger
48b6837074
[subset] add a CFF specific accelerator object.
...
This allows CFF specific accelerator structures to be isolated to the CFF code.
2022-11-24 21:13:59 +00:00
Behdad Esfahbod
d77f346d1a
[subset-cff] Minor rename
2022-11-24 14:02:46 -07:00
Behdad Esfahbod
29a0fa089a
[subset-cff] Micro-optimize
2022-11-24 14:00:59 -07:00
Behdad Esfahbod
d480ae1fac
[cff] Remove unused function
2022-11-24 13:53:43 -07:00
Behdad Esfahbod
73046d53e5
[shaper] Disable dumber shaper if no AAT
2022-11-24 13:49:29 -07:00
Behdad Esfahbod
e9f964c01a
[ot-face] Declare more tables as core
2022-11-24 13:38:53 -07:00
Behdad Esfahbod
5bc27a128d
[machinery] Comment
2022-11-24 13:30:12 -07:00
Behdad Esfahbod
d21bfb0861
[normalize] Remove an unlikely
...
Keep unlikely for truely unlikely scenarios.
2022-11-24 13:14:05 -07:00