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 710972 - gtk_text_view_get_iter_location scales badly with wrapping
gtk_text_view_get_iter_location scales badly with wrapping
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
3.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-10-27 19:12 UTC by Arpad Borsos
Modified: 2018-04-15 00:15 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Arpad Borsos 2013-10-27 19:12:07 UTC
get_iter_location is a lot slower when setting wrap_mode to WORD (haven’t tested with other values)

It also scales linearly with the length of the line. Doubling the length (and thus the number of wrapped lines) also doubles the runtime of get_iter_location.
Comment 1 Matthias Clasen 2013-10-27 23:07:56 UTC
Many things in gtktextview don't scale well if you have very long lines.
That is not an easy thing to fix.
Comment 2 Arpad Borsos 2013-11-02 12:16:20 UTC
So the investigations I did in bug 710973 showed that parts in gtksourceview, namely show_line_numbers and draw_spaces call this function a lot with different lines, so the cache here https://git.gnome.org/browse/gtk+/tree/gtk/gtktextlayout.h#n147 does not work in this case.

I see pango_layout_get_extents very high up in the profiles, which means it re-generates the lines over and over again. gtk_text_layout_free_line_display is also high in the profiles, supporting the hypothesis that the cache is pretty useless in this particular usecase.

How feasible is it to keep around one GtkTextLineDisplay per visible line in the viewport?
Comment 3 Matthias Clasen 2013-11-02 18:05:27 UTC
It is also supporting the hypothesis that some of the features of GtkSourceView would be better off implemented inside GtkTextView
Comment 4 Matthias Clasen 2018-02-10 05:18:21 UTC
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
Comment 5 Matthias Clasen 2018-04-15 00:15:16 UTC
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla.

If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab:

https://gitlab.gnome.org/GNOME/gtk/issues/new