GNOME Bugzilla – Bug 700581
Improve performances by removing some redundant UTF-8 checks
Last modified: 2014-08-15 03:37:48 UTC
There are some redundant UTF-8 checks in GtkTextView, so it degrades performances. Also, allowing invalid UTF-8 chars is a first step to fix bug #637270.
Created attachment 244624 [details] [review] GtkTextView: remove some redundant UTF-8 checks It improves the performances. The documentation says that the strings must be in UTF-8 format, so normally the applications call g_utf8_validate() before gtk_text_buffer_insert() or similar.
With the patch applied, all the g_utf8_validate() in gtktext*.c are gone.
Created attachment 244635 [details] Test the performances of gtk_text_buffer_insert() Here are the results with a 254 MB file: With the UTF-8 checks in GtkTextView: > Elapsed time: 7.28 Without: > Elapsed time: 5.80 Unfortunately, when the file is opened with gedit, there is not a big difference with or without the patch. There are other things that take more time.
You might like to bump the gtk dev mailing list to ask for a review and see if the devs think this is a good idea or not.
Timothy, this bug will be fixed when the bug #637270 is fixed (there is a dependency between the two bugs). Fixing this bug alone will not improve a lot the performances when opening a big file. The bottleneck in gedit is elsewhere.
Well then I dont see much point in keeping this bug open. Seeing as the performance gain is so small there is not much point removing these checks without doing the rest of what is required in the other bug which means there seems no need to track this part separately. *** This bug has been marked as a duplicate of bug 637270 ***
Hrm, this bug is NOT a duplicate. The patch can be useful in the future. If you want to triage bugs, this one is the wrong place.
I guess my point was the patch is so small it should probably just be part of a patch series for the other bug since its not much use on its own.
I don't think it is a good idea to take out utf8 validation before we are able to handle non-utf8 text.