Skip to content

Reduce the number of heap allocation of delatSet of variation data

Seigo Nonaka requested to merge nona/free-type-nona-fork:master into master

The deltaSet is a packed integers which can be 32 bits, 16 bits or 8 bits. Before this change, these values are unpacked to 32 bits integers. However, this can be a big heap allocation, e.g. 500 KB on NotoSansCJK. To reduce the amount of heap allocation, store the packed integers and unpack them just before passing to the calculation.

At the calculation time, due to the variable length of region indices, temporary heap allocations are necessary. This heap allocation is not negligible and visible in ftbench result. So, use stack allocated arrays for short array calculating.

Fixes #1230 (closed)

Merge request reports