boring-expansion-spec icon indicating copy to clipboard operation
boring-expansion-spec copied to clipboard

Larger/faster version of MultiItemVariationData

Open behdad opened this issue 1 year ago • 3 comments

The following takes more spec, but is faster to parse, than the existing format1:

struct MultiItemVariationData
{
  uint8 Format; // 2
  uint16 regionIndexCount;
  uint16 regionIndexes[regionIndexCount];
  CFF2IndexOf<float[]> deltaSets;
};

behdad avatar Sep 26 '24 21:09 behdad

Please explain the benefit of using float here, rather than int16 or int32.

Lorp avatar Sep 30 '24 18:09 Lorp

Please explain the benefit of using float here, rather than int16 or int32.

Good point. I'll measure the runtime and report.

behdad avatar Oct 01 '24 17:10 behdad

Please explain the benefit of using float here, rather than int16 or int32.

Good point. I'll measure the runtime and report.

I tried int32.

I can measure about 6% speedup using floats. This is because the numbers need to be converted to float and multiplied by a float and added; I also have SIMD codepath for SSE and NEON for the float, but those seem to have very small effect.

behdad avatar Oct 03 '24 21:10 behdad