After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 734195 - vteaccess: inefficient per-byte loops
vteaccess: inefficient per-byte loops
Status: RESOLVED OBSOLETE
Product: vte
Classification: Core
Component: general
0.37.x
Other Linux
: Normal minor
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-08-03 10:28 UTC by Egmont Koblinger
Modified: 2021-06-10 14:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Egmont Koblinger 2014-08-03 10:28:00 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?
Comment 1 Egmont Koblinger 2015-02-01 19:41:37 UTC
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.
Comment 2 GNOME Infrastructure Team 2021-06-10 14:55:05 UTC
-- 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.