This is an automated email from the git hooks/post-receive script.
git pushed a commit to reference refs/pull/38/head
in repository terminology.
View the commit online.
commit 2ef45562dedd5974da63da337ed6bfc5a82e62a1
Author: [email protected] <[email protected]>
AuthorDate: Thu Apr 23 18:31:19 2026 -0600
perf: skip per-cell block id lookup when no blocks exist
termpty_block_id_get was called once per visible cell per render
frame (~40M times per typical session) even though the block hash
is empty in all workloads without inline images / media cells.
Gate the call on a row-invariant has_blocks flag computed once at
the top of termio_internal_render. No behavior change when blocks
are present.
---
src/bin/termiointernals.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/bin/termiointernals.c b/src/bin/termiointernals.c
index 1dfa7846..ad851282 100644
--- a/src/bin/termiointernals.c
+++ b/src/bin/termiointernals.c
@@ -2404,6 +2404,7 @@ termio_internal_render(Termio *sd,
int sel_start_x = 0, sel_start_y = 0, sel_end_x = 0, sel_end_y = 0;
Termblock *blk;
Eina_List *l;
+ Eina_Bool has_blocks = (sd->pty->block.blocks != NULL);
EINA_LIST_FOREACH(sd->pty->block.active, l, blk)
{
@@ -2553,9 +2554,10 @@ termio_internal_render(Termio *sd,
}
else
{
- int bid, bx = 0, by = 0;
+ int bid = -1, bx = 0, by = 0;
- bid = termpty_block_id_get(&(cells[x]), &bx, &by);
+ if (EINA_UNLIKELY(has_blocks))
+ bid = termpty_block_id_get(&(cells[x]), &bx, &by);
if (bid >= 0)
{
if (ch1 < 0)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.