From d155a10dffb3d7af7d1d39a892d5942f2688fbdb Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 21 Aug 2026 01:10:56 -0600 Subject: [PATCH] [ot-shape] Skip the post-morx digest update if not applying GPOS (#6192) The buffer digest is only consumed by the OT lookup-apply loop. After morx substitution it exists solely for a following GPOS pass; when positioning goes through kerx/kern instead, rebuilding it is wasted work. Speeds up the Menlo/en-thelittleprince benchmark by 2%; shaping outputs are unchanged on the AAT benchmark fonts. Co-authored-by: Claude Fable 5 --- src/hb-ot-shape.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index 912a9628c..691642402 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -922,7 +922,10 @@ hb_ot_substitute_plan (const hb_ot_shape_context_t *c) { hb_aat_layout_substitute (c->plan, c->font, c->buffer, c->user_features, c->num_user_features); - c->buffer->update_digest (); + /* The buffer digest is only used by the OT lookup-apply loop; + * without GPOS ahead, nothing consumes it. */ + if (c->plan->apply_gpos) + c->buffer->update_digest (); } else #endif