From 9644971dafdba4051994fe0be1192ebb3346f9df Mon Sep 17 00:00:00 2001 From: iris-ai <4+iris-ai@noreply.localhost> Date: Tue, 15 Sep 2026 13:37:34 -0400 Subject: [PATCH] Inline the write a glyph goes through Whether the inliner took DrawLayers::write into Painter::glyphs turned out to depend on unrelated code elsewhere in iris-core: adding the declared-length resolution pushed it out, and a call per glyph cost 12% of a resize frame with every counter -- widget draws, primitive writes, text renders -- unchanged. Saying so directly leaves the two decisions independent. The random-tree rig is 12.59B instructions where it was 13.25B before either change. Co-Authored-By: Claude Opus 5 --- core/src/primitive/layer.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/primitive/layer.rs b/core/src/primitive/layer.rs index 3fb2411..1329d70 100644 --- a/core/src/primitive/layer.rs +++ b/core/src/primitive/layer.rs @@ -120,6 +120,10 @@ impl Layers { } impl DrawLayers { + /// Inlined on purpose: it is one call per glyph, the innermost thing a + /// frame does, and whether the inliner takes it turns out to depend on + /// unrelated code elsewhere in the crate -- 12% of a resize frame. + #[inline] pub fn write( &mut self, layer: LayerId,