src/hb-subset-cff-common.hh


Log

Author Commit Date CI Message
Behdad Esfahbod 043eeb29 2022-12-02T13:58:36 [subset-cff] Optimize encode_subrs Don't loop over all original subrs. Just walk over closure subrs.
Behdad Esfahbod 0ad5977c 2022-12-02T13:41:06 [subset-cff] Simplify hinting processing We already have drop_hints in the params.
Behdad Esfahbod c9476527 2022-12-01T21:48:35 [subset-cff] Micro-optimize
Behdad Esfahbod a5616227 2022-12-01T20:11:34 [subset-cff] Fix buffer size calculation
Behdad Esfahbod 015af5a8 2022-12-01T20:08:59 [subset-cff] Write a couple loops as range-based for
Behdad Esfahbod bfbbd4af 2022-12-01T20:05:20 [subset-cff] Copy str for call ops
Behdad Esfahbod c755b388 2022-12-01T20:02:38 [subset-cff] Pre-alloc enough for check-less copy
Behdad Esfahbod 062e59ae 2022-12-01T19:43:48 [subset-cff] Optimize vector allocation for preprocessed input
Behdad Esfahbod 2644540a 2022-12-01T18:49:09 [subset-cff] Compact parsed strings if using accelerator Saves 32% on SourceHanSans/10000 benchmark! Also, use memcmp now for writing out strings since now that our ops are not super short, that's faster. This makes cff-japanese test takes super long though; that needs inspection.
Behdad Esfahbod 32dd9810 2022-11-30T13:15:58 [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
Garret Rieger 7551a668 2022-11-30T00:04:16 [subset] Make cff_accelerator const. This gives more confidence that it won't be accidentally modified by the subset operation using it.
Behdad Esfahbod 3ea0f37c 2022-11-28T13:58:44 [subset-cff] Move an init to constructor The init was not called anyway.
Behdad Esfahbod 6c92c3e0 2022-11-28T13:54:24 [subset-cff] Remove unnecessary check
Behdad Esfahbod 7fd300dd 2022-11-28T13:51:16 [subset-cff] Use constructor for parsed_cs_op_t
Garret Rieger bd37900e 2022-11-28T20:35:34 [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.
Behdad Esfahbod ded9de9c 2022-11-28T13:31:40 [cff] bsearch in fdselect Saves 8% in NotoSansCJK / 10000 subset benchmark.
Behdad Esfahbod 0c33aba3 2022-11-28T12:28:13 [subset-cff] Rename drop flag to hinting flag
Behdad Esfahbod 6f5b5319 2022-11-28T11:39:24 [subset-cff] Make no-hinting use accelerator as well
Behdad Esfahbod f51a624e 2022-11-27T14:54:39 [subset-cff] Micro-optimize drop_hints_in_str
Behdad Esfahbod 38603266 2022-11-27T13:23:13 [subset-cff] Write loop more idiomatic
Behdad Esfahbod 3ff502d3 2022-11-27T12:58:04 [subset-cff] Remove unnecessary initialization
Behdad Esfahbod 6af4985b 2022-11-26T18:20:20 [subset-cff] No need for bitflag here anymore
Behdad Esfahbod 69ce606d 2022-11-26T18:18:35 [subset-cff] Immediately drop subr numbers instead of marking for skip Seems to work and saves ~2% time.
Behdad Esfahbod 1cf4f3e0 2022-11-26T18:15:28 [subset-cff] More comment
Behdad Esfahbod f68221ff 2022-11-26T18:12:14 [subset-cff] Add comment
Behdad Esfahbod 048ab8a0 2022-11-26T18:00:43 [subset-cff] Remove unused bits
Behdad Esfahbod 37cbfc0c 2022-11-26T17:57:44 [subset-cff] Remove unneeded member
Behdad Esfahbod 46ab1513 2022-11-26T17:49:21 [subset-cff] Add has_calls to parsed charstrings Optimize closure based on it.
Behdad Esfahbod 6d53074e 2022-11-26T17:23:09 [subset-cff] Drop another unused parameter
Behdad Esfahbod 42615561 2022-11-26T17:10:58 Optimize a couple array references
Behdad Esfahbod 04d23b7c 2022-11-26T17:08:00 [subset-cff] Micro-optimize collect_subr_refs_in_str
Garret Rieger a5d35fd8 2022-11-25T23:17:05 [subset] use charstrings directly from accelerator cache if mutability isn't needed.
Behdad Esfahbod 74acf52f 2022-11-25T14:43:44 [subset-cff] Micro-optimize copy_str more
Behdad Esfahbod d2f3cde7 2022-11-25T14:38:30 [subset-cff] Micro-optimize copy_str
Behdad Esfahbod 22990fca 2022-11-25T14:12:58 Merge pull request #3894 from googlefonts/cff_accel [subset] Cache parsed char strings in CFF accelerator
Garret Rieger 8d5c899b 2022-11-25T20:33:39 [subset] In cff accelerator hold reference to CFF table instead of the whole font.
Garret Rieger 75a99f28 2022-11-25T18:38:13 [subset] destruct cff accelerator if present.
Behdad Esfahbod 1d474194 2022-11-25T13:21:35 [subset-cff] Micro-optimize encode_str
Behdad Esfahbod 3c4a610b 2022-11-25T13:16:30 [subset-cff] Micro-optimize copy_str some more
Behdad Esfahbod 535aadb3 2022-11-25T13:07:42 [subset-cff] Micro-optimize collect_subr_refs_in_str more
Behdad Esfahbod 00a9df3a 2022-11-25T13:05:05 [subset-cff] Micro-optimize collect_subr_refs_in_str
Garret Rieger 71c23c1c 2022-11-25T18:04:44 [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.
Garret Rieger 4ff09274 2022-11-24T22:47:29 [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.
Garret Rieger a3afa61c 2022-11-23T22:24:39 [subset] use cached parsed char strings if available.
Garret Rieger 47c12584 2022-11-23T21:02:39 [subset] Cache parsed charstrings in the cff accelerator.
Garret Rieger 48b68370 2022-11-23T20:51:51 [subset] add a CFF specific accelerator object. This allows CFF specific accelerator structures to be isolated to the CFF code.
Behdad Esfahbod d77f346d 2022-11-24T14:02:46 [subset-cff] Minor rename
Behdad Esfahbod 29a0fa08 2022-11-24T14:00:59 [subset-cff] Micro-optimize
Behdad Esfahbod 0bf7d9eb 2022-11-23T13:00:23 [subset-cff] Micro-optimize encode_byte
Behdad Esfahbod a23f8204 2022-11-23T12:56:13 [subset-cff] Micro-optimize array access
Behdad Esfahbod 59c45f6d 2022-11-22T12:54:50 Use hb_memcpy instead of memcpy consistently
Behdad Esfahbod c53c6481 2022-11-22T12:46:25 [subset-cff] Another handrolled memcpy
Behdad Esfahbod 1572ba28 2022-11-21T22:26:44 [subset-cff] Return in subr closure if already seen subr Not sure why this was not done before.
Behdad Esfahbod a29ca6ef 2022-11-21T22:02:17 [subset-cff] Comment
Behdad Esfahbod 28e767dd 2022-11-21T21:59:51 [subset-cff] Really optimize op_str_t / parsed_cs_op_t layout Now parsed_cs_op_t and op_str_t are both 16 bytes. Saves another 7% in SourceHanSans/10000 benchmark.
Behdad Esfahbod 2d5ee237 2022-11-21T21:37:38 [subset-cff] Readjust parsed_cs_op_t Now it doesn't matter anymore since op_str_t is adjusted and is 16 bytes with 8byte alignment.
Behdad Esfahbod 4f056b92 2022-11-21T21:37:38 [subset-cff] Optimize op_str_t layout
Behdad Esfahbod dc3bb5e0 2022-11-21T18:18:48 [subset-cff] Pre-allocate values array for subroutines as well
Behdad Esfahbod c6279224 2022-11-21T18:01:50 [cff] Adjust pre-allocation This better matches actual usage, given that ops are one or two bytes, and vector also allocates 50% extra.
Behdad Esfahbod 2cadacad 2022-11-21T17:17:15 [cff] Simplify str_encoder_t error handling
Behdad Esfahbod f263e3fe 2022-11-21T17:04:55 [cff] Manually copy short strings instead of memcpy()
Behdad Esfahbod 38efd186 2022-11-21T17:02:11 [cff] Add a likely()
Behdad Esfahbod 191025cc 2022-11-21T16:58:19 [cff] Adjust buffer pre-allocation Most ops take one or two bytes, so allocate count*2, not count*3. Shows minor speedup in subsetting benchmark (around 2%).
Behdad Esfahbod 4b2caafe 2022-11-21T16:46:20 [subset-cff] Optimize parsed_cs_op_t size Shows 5% speedup on SourceHanSans-Regular/10000 benchmark.
Garret Rieger 98aaecd3 2022-06-01T21:01:16 [subset] fix data race touching Crap() in cff subsetting.
Behdad Esfahbod e91863b7 2022-05-18T12:39:55 [subset-cff] Pre-size map in subr_remap_t::create()
Behdad Esfahbod b5aa8a27 2022-05-18T11:58:58 [subset-cff] Cosmetic
Behdad Esfahbod 0b201623 2022-05-18T11:58:22 [subset-cff] Fix previous commit Oops!
Behdad Esfahbod 47923092 2022-05-18T11:54:08 [subset-cff] Access vector directly
Behdad Esfahbod 7c86f2e7 2022-05-18T11:45:27 [subset-cff] Pre-alloc out buffer
Behdad Esfahbod 0761e7cd 2022-05-18T11:37:57 [subset-cff] Avoid resetting buffer as encoder does
Behdad Esfahbod 71aa10a3 2022-05-18T11:37:24 [subset-cff] Manually grow vector to avoid memset overhead
Behdad Esfahbod f455cc53 2022-05-18T11:31:55 [subset-cff] Reuse buffer allocation
Behdad Esfahbod fb413f52 2022-05-16T17:08:43 [subset/cff] Don't use bitfields for hot bools The struct has room because of alignment, and these bools are hot.
Behdad Esfahbod f0853796 2022-05-11T12:10:03 [cff-subset] Pre-alloc vector for operator decoding
Behdad Esfahbod bff78e65 2022-05-10T16:33:37 [cff] Convert interpretation environment to use constructor
Behdad Esfahbod de053e2e 2022-05-10T15:38:37 [cff] Convert subr_subset_param_t to use constructor
Behdad Esfahbod 8aa54aac 2022-05-09T16:09:56 [cff] Replace byte_str_t with hb_bytes_t use
Behdad Esfahbod fe783ac0 2022-01-18T13:38:28 [cff] Remove op_str_t nop init/fini
Garret Rieger f1dc8b08 2022-01-18T10:29:04 [subset-cff] Convert subr_closures_t to constructor/destructor instead of init/fini.
Behdad Esfahbod a48aa985 2022-01-18T09:32:58 [subset-cff] Remove another set of fini_deep
Behdad Esfahbod de2cef42 2022-01-18T09:21:31 [bimap] Remove init/fini
Garret Rieger 46d4a5e6 2021-07-29T15:07:13 [subset] Convert subset plan to use a flags bit set.
Garret Rieger 32f052b0 2020-07-30T13:45:04 [ENOMEM] Fix several instances of not checking resize in CFF.
Ebrahim Byagowi 2be859d2 2020-04-20T23:48:23 minor, replace nullptr checks with implicit ones
Ebrahim Byagowi 2dda6dd7 2020-04-20T14:12:45 minor, tweak spacing turn 8 spaces to tab, add space before Null/Crap
ariza 0b290538 2020-03-04T22:31:21 removed unused code
ariza e8f010d7 2020-03-04T16:54:27 removed unused code & data; rename
ariza c05458ec 2020-03-02T16:51:19 update cff & cff2 subsetters
Ebrahim Byagowi ce114d6b 2019-12-31T15:53:02 minor, tweak spaces
Ebrahim Byagowi 453050ad 2019-10-13T08:38:56 Merge remote-tracking branch 'upstream/master' into var-subset
Ebrahim Byagowi c7621cf2 2019-10-08T13:24:26 Minor, replace hb_set_add with private API
Ebrahim Byagowi 0558413f 2019-10-01T13:49:55 Minor, tweak spaces
blueshade7 8bf989ea 2019-07-08T17:13:29 update from master
Michiharu Ariza f3ee2bd0 2019-06-20T14:33:09 add ops & methods to hb_bimap_t making it more like hb_map_t moved has () to hb_bimap_t from hb_inc_bimap_t moved identity () to hb_inc_bimap_t removed forward()
Michiharu Ariza 09496695 2019-06-17T22:12:40 add hb_bimap_t, subclass hb_inc_bimap_t replacing CFF::remap_t
Michiharu Ariza a1177fec 2019-03-29T08:43:47 Merge branch 'master' into var-subset rebase master
Behdad Esfahbod b986c6a3 2019-03-29T20:17:46 [C++11] Remove IntType::set() in favor of operator=
Michiharu Ariza f1e97c18 2019-02-25T09:59:27 renamed hb_map2_t to hb_bimap_h in its own .hh
Michiharu Ariza a00d1d5e 2019-02-21T16:34:49 fix CFF2 local subr subsetting bug exposed by impl change of fdmap also fixed name of subr_remap_ts as subr_remaps_t