From 0f6fecfaf4abbd56c0a66eb2428e1bcc259a348d Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 24 Dec 2025 00:34:54 -0700 Subject: [PATCH] [calculate_scalar] Only jumpskip if num-coords >= 16 Otherwise, it was slowing down GoogleSansFlex rendering. --- src/hb-ot-var-common.hh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-var-common.hh b/src/hb-ot-var-common.hh index ef3149a55..1f1270386 100644 --- a/src/hb-ot-var-common.hh +++ b/src/hb-ot-var-common.hh @@ -152,12 +152,18 @@ struct TupleVariationHeader } double scalar = 1.0; +#ifndef HB_OPTIMIZE_SIZE +#if HB_FAST_NUM_ACCESS + bool skip = coord_count >= 16; +#endif +#endif for (unsigned int i = 0; i < coord_count; i++) { #ifndef HB_OPTIMIZE_SIZE #if HB_FAST_NUM_ACCESS - while (i + 4 < coord_count && * (HBUINT64LE *) &peak_tuple[i] == 0) - i += 4; + if (skip) + while (i + 4 < coord_count && * (HBUINT64LE *) &peak_tuple[i] == 0) + i += 4; #endif #endif