Commit Graph

14486 Commits

Author SHA1 Message Date
Behdad Esfahbod c755b3884f [subset-cff] Pre-alloc enough for check-less copy 2022-12-02 12:01:35 -07:00
Behdad Esfahbod 062e59ae67 [subset-cff] Optimize vector allocation for preprocessed input 2022-12-02 12:01:35 -07:00
Behdad Esfahbod 8e9e94dba9 Revert "[vector] Optimize grow_vector() for size"
This reverts commit 1dd9396c7a.

Is faster indeed.

15% on SourceHanSans/10000 benchmark.
2022-12-02 12:01:35 -07:00
Behdad Esfahbod 2644540a74 [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.
2022-12-02 12:01:35 -07:00
Behdad Esfahbod 6012d3b228 [subset-cff] Write out charstrings zerocopy to serializer 2022-12-01 17:33:53 -07:00
Behdad Esfahbod 36e1a6339c [cff] Add total_size to INDEX 2022-12-01 17:00:03 -07:00
Behdad Esfahbod 3843000660 [serialize] Add start_zerocopy() 2022-12-01 16:48:22 -07:00
Behdad Esfahbod a2681c37c1 [cff-subset] Simplify INDEX serialize() more 2022-12-01 16:15:23 -07:00
Behdad Esfahbod c4b05878cb [subset-cff] Remove INDEX unused serialize() methods 2022-12-01 15:56:37 -07:00
Behdad Esfahbod b3ad4d72cc [cff] Another no-memset in INDEX 2022-12-01 15:46:00 -07:00
Behdad Esfahbod 5fd2f255fc [open-type] Don't memset 0 in serialize for ArrayOf family
Not necessary.
2022-12-01 15:18:59 -07:00
Behdad Esfahbod 70ac6dfb28 [subset-cff] Don't memset 0 INDEX and other serialize methods
Not necessary.
2022-12-01 14:58:25 -07:00
Behdad Esfahbod a66de336fb [vector] Minor use get_size() in as_bytes() 2022-12-01 14:32:13 -07:00
Behdad Esfahbod 0b826368fd [serializer] Don't memset memory in embed
Not necessary.
2022-12-01 14:23:25 -07:00
Behdad Esfahbod 3b68c7146f [array] Don't clear serializer buffer when copying out
Not needed.
2022-12-01 14:19:27 -07:00
Behdad Esfahbod 57808609c9 [VarData] Move an unlikely 2022-12-01 14:03:56 -07:00
Behdad Esfahbod 8805a866b5 [ClassDef2] Write a few loops as range-based for 2022-11-30 17:18:04 -07:00
Behdad Esfahbod ac8b232a2d [gsub] Cache intersects_class results for closure
Benchmark                                                                                 Time             CPU      Time Old      Time New       CPU Old       CPU New
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/10                  +0.0246         +0.0240             0             0             0             0
BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/64                  -0.5541         -0.5544             4             2             4             2
BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/512                 -0.1120         -0.1123            43            38            43            38
BM_subset/subset_codepoints/NotoNastaliqUrdu-Regular.ttf/nohinting/1400                -0.1154         -0.1159            43            38            43            38
2022-11-30 17:09:04 -07:00
Behdad Esfahbod 20a0a46729 [perf] Remove stale run.sh 2022-11-30 15:59:54 -07:00
Behdad Esfahbod 38e7bc345c [benchmark-subset] Support testing arbitrary fonts from cmdline 2022-11-30 15:02:42 -07:00
Behdad Esfahbod c6a4b60116 [gsubgpos] Add an unlikely 2022-11-30 15:02:42 -07:00
Behdad Esfahbod d4dec54c3a [ci] Switch configs build to Ubuntu 20.04
https://github.com/actions/runner-images/issues/6002
2022-11-30 14:14:54 -07:00
Behdad Esfahbod 52d8346d99 [ci] Change Linux runner to Ubuntu 20.04
https://github.com/actions/runner-images/issues/6002
2022-11-30 14:14:54 -07:00
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
Satadru Pramanik 58925ed9a0 Update freetype subproject to 2.12.1 2022-11-29 12:42:58 -07:00
Christoph Reiter 80dd751564 CI: work around flaky 64bit MSYS2 builds
MSYS2 Python+meson has some random crashes in CI which we haven't been
able to reproduce yet. Naturally enabling debugging fixes them.. :)
2022-11-29 12:41:02 -07:00
Christoph Reiter 8f41b6a139 CI: fix msvc build
The Windows image for some reason now contains a zlib and freetype build
which meson finds and tries to use. Force meson to use the subprojects always
to avoid picking up system libs.
2022-11-29 12:41:02 -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