Commit Graph

93 Commits

Author SHA1 Message Date
Behdad Esfahbod 59c45f6deb Use hb_memcpy instead of memcpy consistently 2022-11-22 12:54:50 -07:00
Behdad Esfahbod c53c648127 [subset-cff] Another handrolled memcpy 2022-11-22 12:46:25 -07:00
Behdad Esfahbod 1572ba281a [subset-cff] Return in subr closure if already seen subr
Not sure why this was not done before.
2022-11-21 22:26:44 -07:00
Behdad Esfahbod a29ca6efbc [subset-cff] Comment 2022-11-21 22:02:17 -07:00
Behdad Esfahbod 28e767ddea [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.
2022-11-21 21:59:51 -07:00
Behdad Esfahbod 2d5ee23731 [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.
2022-11-21 21:55:21 -07:00
Behdad Esfahbod 4f056b923a [subset-cff] Optimize op_str_t layout 2022-11-21 21:37:57 -07:00
Behdad Esfahbod dc3bb5e0ed [subset-cff] Pre-allocate values array for subroutines as well 2022-11-21 18:18:48 -07:00
Behdad Esfahbod c6279224db [cff] Adjust pre-allocation
This better matches actual usage, given that ops are one or two
bytes, and vector also allocates 50% extra.
2022-11-21 18:01:50 -07:00
Behdad Esfahbod 2cadacad6c [cff] Simplify str_encoder_t error handling 2022-11-21 17:17:15 -07:00
Behdad Esfahbod f263e3fe2e [cff] Manually copy short strings instead of memcpy() 2022-11-21 17:04:55 -07:00
Behdad Esfahbod 38efd1862f [cff] Add a likely() 2022-11-21 17:02:11 -07:00
Behdad Esfahbod 191025cc96 [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%).
2022-11-21 16:58:19 -07:00
Behdad Esfahbod 4b2caafea2 [subset-cff] Optimize parsed_cs_op_t size
Shows 5% speedup on SourceHanSans-Regular/10000 benchmark.
2022-11-21 16:46:20 -07:00
Garret Rieger 98aaecd397 [subset] fix data race touching Crap() in cff subsetting. 2022-06-01 22:50:35 +01:00
Behdad Esfahbod e91863b717 [subset-cff] Pre-size map in subr_remap_t::create() 2022-05-18 12:39:55 -06:00
Behdad Esfahbod b5aa8a27ea [subset-cff] Cosmetic 2022-05-18 11:58:58 -06:00
Behdad Esfahbod 0b201623f5 [subset-cff] Fix previous commit
Oops!
2022-05-18 11:58:22 -06:00
Behdad Esfahbod 4792309265 [subset-cff] Access vector directly 2022-05-18 11:54:08 -06:00
Behdad Esfahbod 7c86f2e763 [subset-cff] Pre-alloc out buffer 2022-05-18 11:45:27 -06:00
Behdad Esfahbod 0761e7cdfd [subset-cff] Avoid resetting buffer as encoder does 2022-05-18 11:38:25 -06:00
Behdad Esfahbod 71aa10a394 [subset-cff] Manually grow vector to avoid memset overhead 2022-05-18 11:37:24 -06:00
Behdad Esfahbod f455cc53fd [subset-cff] Reuse buffer allocation 2022-05-18 11:31:55 -06:00
Behdad Esfahbod fb413f5202 [subset/cff] Don't use bitfields for hot bools
The struct has room because of alignment, and these bools are hot.
2022-05-16 17:38:18 -06:00
Behdad Esfahbod f08537963b [cff-subset] Pre-alloc vector for operator decoding 2022-05-11 12:14:49 -06:00
Behdad Esfahbod bff78e6515 [cff] Convert interpretation environment to use constructor 2022-05-10 16:50:38 -06:00
Behdad Esfahbod de053e2efb [cff] Convert subr_subset_param_t to use constructor 2022-05-10 16:17:20 -06:00
Behdad Esfahbod 8aa54aaca2 [cff] Replace byte_str_t with hb_bytes_t use 2022-05-09 17:34:58 -06:00
Behdad Esfahbod fe783ac091 [cff] Remove op_str_t nop init/fini 2022-01-18 13:38:28 -07:00
Garret Rieger f1dc8b087c [subset-cff] Convert subr_closures_t to constructor/destructor instead of init/fini. 2022-01-18 10:29:04 -08:00
Behdad Esfahbod a48aa9850a [subset-cff] Remove another set of fini_deep 2022-01-18 09:32:58 -07:00
Behdad Esfahbod de2cef42b4 [bimap] Remove init/fini 2022-01-18 09:21:31 -07:00
Garret Rieger 46d4a5e673 [subset] Convert subset plan to use a flags bit set. 2021-07-29 18:02:34 -07:00
Garret Rieger 32f052b033 [ENOMEM] Fix several instances of not checking resize in CFF. 2020-07-31 02:04:06 +04:30
Ebrahim Byagowi 2be859d289 minor, replace nullptr checks with implicit ones 2020-04-21 00:30:34 +04:30
Ebrahim Byagowi 2dda6dd744 minor, tweak spacing
turn 8 spaces to tab, add space before Null/Crap
2020-04-20 16:18:29 +04:30
ariza 0b29053864 removed unused code 2020-03-05 10:11:23 +03:30
ariza e8f010d793 removed unused code & data; rename 2020-03-05 10:11:23 +03:30
ariza c05458ec7f update cff & cff2 subsetters 2020-03-05 01:22:51 +03:30
Ebrahim Byagowi ce114d6b27 minor, tweak spaces 2019-12-31 15:53:02 +03:30
Ebrahim Byagowi 453050ad30 Merge remote-tracking branch 'upstream/master' into var-subset 2019-10-13 08:45:29 +03:30
Ebrahim Byagowi c7621cf211 Minor, replace hb_set_add with private API 2019-10-08 15:40:29 +03:30
Ebrahim Byagowi 0558413f27 Minor, tweak spaces 2019-10-01 13:50:11 +03:30
blueshade7 8bf989ea70 update from master 2019-07-08 17:13:29 -07:00
Michiharu Ariza f3ee2bd020 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()
2019-06-25 13:52:40 -07:00
Michiharu Ariza 094966959f add hb_bimap_t, subclass hb_inc_bimap_t replacing CFF::remap_t 2019-06-25 13:52:40 -07:00
Michiharu Ariza a1177fec8f Merge branch 'master' into var-subset
rebase master
2019-03-29 23:23:49 -07:00
Behdad Esfahbod b986c6a321 [C++11] Remove IntType::set() in favor of operator= 2019-03-29 20:21:21 -07:00
Michiharu Ariza f289ffe5ea renamed hb_map2_t to hb_bimap_h in its own .hh 2019-03-14 16:58:02 -07:00
Michiharu Ariza c485b77c7c fix CFF2 local subr subsetting
bug exposed by impl change of fdmap
also fixed name of subr_remap_ts as subr_remaps_t
2019-03-14 16:58:02 -07:00