Text reflow performance #3 #539

Manually merged
dnkl merged 3 commits from reflow-osc8-performance into master 6 months ago
dnkl commented 6 months ago
Owner

This improves the text reflow performance when there are lots of OSC-8 URI ranges in the grid.

Since we know the following:

  • URI ranges are sorted
  • URI coordinates are unique
  • URI ranges don’t span multiple rows

We can optimize URI range reflowing by:

  • Checking if the first URI range’s start coordinate is on the current column. If so, keep a pointer to it.
  • Use this pointer as source when instantiating the reflowed URI range.
  • If we already have a non-NULL range pointer, check its end coordinate instead.
  • If it matches, close the last URI range we inserted on the new row, and free/remove the range from the old row.
  • When line breaking, we only need to check if the last URI range is unclosed.

Part of #504

This improves the text reflow performance when there are lots of OSC-8 URI ranges in the grid. Since we know the following: * URI ranges are sorted * URI coordinates are unique * URI ranges don’t span multiple rows We can optimize URI range reflowing by: * Checking if the *first* URI range’s start coordinate is on the current column. If so, keep a pointer to it. * Use this pointer as source when instantiating the reflowed URI range. * If we already have a non-NULL range pointer, check its end coordinate instead. * If it matches, close the *last* URI range we inserted on the new row, and free/remove the range from the old row. * When line breaking, we only need to check if the *last* URI range is unclosed. Part of #504
dnkl added the
performance
label 6 months ago
dnkl force-pushed reflow-osc8-performance from 768fec16a7 to 9a849b25cc 6 months ago
dnkl merged commit e335d57bc7 into master manually 6 months ago
The pull request has been manually merged as e335d57bc7.
Sign in to join this conversation.
Loading…
There is no content yet.