Skip to content

PERF: Extract non-varying text items out of glyph loop - #32351

Closed
greglucas wants to merge 1 commit into
matplotlib:mainfrom
greglucas:agg-text-loop-hoist
Closed

greglucas wants to merge 1 commit into
matplotlib:mainfrom
greglucas:agg-text-loop-hoist

Conversation

@greglucas

Copy link
Copy Markdown
Contributor

PR summary

_draw_text_glyphs_and_boxes runs once per glyph of every string drawn. I get about 1.1-1.2x speedup locally with this.

AI Disclosure

AI found this and implemented the initial updates, I reviewed and cleaned up all code.

PR quality check

  • Use an expressive title, e.g. "Fix title font property precedence"
  • New and changed code is tested

_draw_text_glyphs_and_boxes runs once per glyph of every string drawn.
@iccir

iccir commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

I think this might be covered already in #32120, which needs a second review? (I'm on top of a mountain in the wilderness and can't check!)

@greglucas

Copy link
Copy Markdown
Contributor Author

Indeed! I missed that when I was searching, thanks for pointing it out. I'll take a look.

@greglucas greglucas closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants