Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 52952
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Linux Gnome Desktop Team <gnome@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: devsk <funtoos@yahoo.com>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
gnome-terminal-2.6.1-dumbo.patch Don't match patterns when not needed patch devsk 2004-06-04 00:35 0000 2.04 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 52952 depends on: Show dependency tree
Bug 52952 blocks: 59768
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2004-06-04 00:32 0000
This patch was submitted to gnome-terminal folks sometime back and it hasn't
made it into the main. Please include it in the next gnome-terminal ebuild. The
bug is as follows: Code tries to match every text selection to a set of
patterns. This matched pattern is not used if CTRL is not pressed. That means
every click and drag of mouse leads to few regular expression searches for the
text getting selected, although the selected text will never be used if CTRL is
not pressed even if it matches one of those regular expressions, hence wasting
CPU cycles for each click. This makes text selection consume lot of CPU and
very slow. This patch moves the pattern matching inside of the check for CTRL
mask so that we match only if CTRL is pressed, hence not hindering normal text
selection.

This patch makes a LOT of difference to g-t's performance.

Reproducible: Always
Steps to Reproduce:
1.Open up a gnome-terminal
2.make the window large. 
3.open a document with large amount of text.
4. start randomly selecting and deselecting text
5. watch how cpu usage goes up and how slow the highlight appears on screen.

Actual Results:  
text selection slow

Expected Results:  
text selection shouldn't so slow.

------- Comment #1 From devsk 2004-06-04 00:35:50 0000 -------
Created an attachment (id=32625) [details]
Don't match patterns when not needed

------- Comment #2 From devsk 2004-06-04 00:37:07 0000 -------
this patch is against 2.6.1

------- Comment #3 From devsk 2004-06-08 20:58:51 0000 -------
any news?

------- Comment #4 From Alastair Tse (RETIRED) 2004-06-09 06:20:31 0000 -------
i think this patch would be better attended to upstream with the gnome-terminal
developers. have you sent this patch to them?

------- Comment #5 From devsk 2004-06-09 08:16:35 0000 -------
yes...report number 122656

http://bugs.gnome.org/show_bug.cgi?id=122656

but it never made it.

------- Comment #6 From devsk 2004-06-18 18:35:58 0000 -------
any news on this patch?

------- Comment #7 From foser (RETIRED) 2004-07-20 04:48:25 0000 -------
it looks good to me.. although i've never seen the described behaviour. I'm not
sure what this has todo with CTRL, i guess thats keyboard behaviour i'm not
familiar with. Can you give a specific scenario to reproduce this ?

Note that with this patch applied i did have a non-reproducable crash, it might
be unrelated.

------- Comment #8 From devsk 2004-07-20 09:05:06 0000 -------
OK, the problem is that when you move your mouse around in a g-t, internally it
searches for patterns(currently only URL spec, skey) matching the strings under
the mouse using regex library. Just have a huge(not nece'ly full screen) g-t
window with lots of text in it and just moving your mouse inside it will raise
your CPU usage. You can hold CTRL down and left click on a URL and it will open
up a epiphany/galeon/mozilla window or CTRL-right click will popup a special
URL menu. The code keeps matching the URL even when CTRL is not held. This
patch makes sure that pattern match happens only when CTRL is pressed, because
that's the only codepath using the matched string.

Selecting text will raise CPU usage more. Huge amounts of scrolling text will
also produce the similar spike in CPU.

------- Comment #9 From Mike Gardiner (RETIRED) 2004-08-17 23:57:34 0000 -------
Added to gnome-terminal 2.6.1-r1.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug