GNOME Bugzilla – Bug 734195
vteaccess: inefficient per-byte loops
Last modified: 2021-06-10 14:55:05 UTC
vteaccess.c contains inefficient and hard-to-read loops like /* Find the first byte that scrolled off. */ for (i = 0; i < priv->snapshot_attributes->len; i++) { attr = g_array_index(priv->snapshot_attributes, struct _VteCharAttributes, i); if (attr.row >= delta + row_count - howmuch) { break; } } whereas there's a snapshot_linebreaks array, getting the value of "i" should be a direct lookup to this array, shouldn't it?
Another missed optimization that should be addressed along with this: From bug 166637 comment 26: in vte_terminal_accessible_update_private_data_if_needed() we could do a binary search instead of a linear one.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vte/-/issues/2122.