geany icon indicating copy to clipboard operation
geany copied to clipboard

Geany on Opensuse Tumbleweed (Gnome) suffers from typing lag

Open bentref opened this issue 7 years ago • 32 comments

When I type in Geany, the letters often take time to appear. For instance, let's say I type 6 characters in 2 seconds. Those 6 characters will appear one at a time, perhaps taking 2.5 or even 4 seconds to appear. This is a serious usability issue, and I have used Geany for a long time but never experienced it before.

This happens at varying degrees of severity on most files I work with. Will update if I discover anything new about the problem.

Some info:

  • OS: Opensuse Tumbleweed
  • Geany: 0.32
  • CPU: Intel Core i3-7100, Intel HD Graphics
  • Desktop Environment: GNOME 3.26
  • GTK theme: Adwaita

Let me know if you need anything more or have any suggestions! Even if you don't have suggestions or solutions, comment if you are having the same problem.

bentref avatar Feb 27 '18 03:02 bentref

Intriguing, I never saw this kind of problem…

Could you check whether it's CPU bound, e.g. does Geany use a lot of CPU when the letters appear? Also, does e.g. scrolling in a file, or open one, show the same kind of lags? If so, maybe you could try and get a backtrace during the lag, by running Geany inside GDB and hitting Ctrl+C while it's lagging, and getting a backtrace there? it might need a few tries to get a meaningful backtrace, but it could potentially show where the slow code lies.

Also, could you post the debugging info from Help → Debug Messages?

b4n avatar Feb 27 '18 04:02 b4n

@bentref please post versions of GTK and Glib Geany is using (Menu->help->debug messages, near the top)

[Edit: heh, overlapped @b4n :) ]

elextr avatar Feb 27 '18 04:02 elextr

@bentref also what filetype is the file you are editing and how big is it? Also does the slow behaviour still happen if you set Edit->preferences->editor->completions->symbol update frequency to 0.

but it could potentially show where the slow code lies.

ctags [educated guess :)]

elextr avatar Feb 27 '18 05:02 elextr

Here is the entire output of the Debug messages. I realize I could try deleting my preferences file too, but I won't do that yet because it might destroy helpful data about this issue.

@b4n asked whether it was CPU intensive when it lagged, but I can't determine this because the lag does not happen when System Monitor is open and I right-click the System Monitor titlebar and click 'Always on Top'. It only happens when Geany is the top layered window, so far. So the lag might be related to windowing or the GNOME Desktop.

Thanks for your help!

08:05:41: Geany INFO : Geany 1.32, en_US.utf8 08:05:41: Geany INFO : GTK 3.22.26, GLib 2.54.3 08:05:41: Geany INFO : System data dir: /usr/share/geany 08:05:41: Geany INFO : User config dir: /home/bentref/.config/geany 08:05:41: Geany INFO : System plugin path: /usr/lib64/geany 08:05:41: Geany INFO : Added filetype Clojure (61). 08:05:41: Geany INFO : Added filetype JSON (62). 08:05:41: Geany INFO : Added filetype Cython (63). 08:05:41: Geany INFO : Added filetype Genie (64). 08:05:41: Geany INFO : Added filetype Graphviz (65). 08:05:41: Geany INFO : Added filetype Scala (66). 08:05:41: Geany INFO : Added filetype CUDA (67). 08:05:41: Geany INFO : Added filetype Arduino (68). 08:05:42: Geany INFO : Loaded libvte from libvte-2.91.so.0 08:05:42: Geany INFO : Loaded: /usr/lib64/geany/autoclose.so (Auto-close) 08:05:42: Geany INFO : Loaded: /usr/lib64/geany/filebrowser.so (File Browser) 08:05:42: Geany INFO : Loaded: /usr/lib64/geany/htmlchars.so (HTML Characters) 08:05:42: Geany INFO : Loaded: /usr/lib64/geany/pairtaghighlighter.so (Pair Tag Highlighter) 08:05:42: Geany INFO : unknown : None (UTF-8) 08:05:54: Geany INFO : /home/bentref/Projects/pygobject/extended.py : Python (UTF-8) 08:05:54: Geany INFO : Loaded /usr/share/geany/tags/std.py.tags (Python), 5964 symbol(s). 08:06:29: Geany INFO : /home/bentref/Projects/pygobject/sandwich.py : Python (UTF-8) 08:06:29: Geany INFO : Wrote /home/bentref/Projects/pygobject/sandwich.py with g_file_set_contents(). 08:06:29: Geany INFO : /home/bentref/Projects/pygobject/sandwich.py : Python (UTF-8) 08:20:24: Geany INFO : Wrote /home/bentref/Projects/pygobject/sandwich.py with g_file_set_contents(). 08:20:24: Geany INFO : /home/bentref/Projects/pygobject/sandwich.py : Python (UTF-8) 08:20:57: Geany INFO : Wrote /home/bentref/Projects/pygobject/sandwich.py with g_file_set_contents(). 08:20:57: Geany INFO : /home/bentref/Projects/pygobject/sandwich.py : Python (UTF-8) 08:21:38: Geany INFO : Wrote /home/bentref/Projects/pygobject/sandwich.py with g_file_set_contents(). 08:21:38: Geany INFO : /home/bentref/Projects/pygobject/sandwich.py : Python (UTF-8) 08:21:49: Geany INFO : Wrote /home/bentref/Projects/pygobject/sandwich.py with g_file_set_contents(). 08:21:49: Geany INFO : /home/bentref/Projects/pygobject/sandwich.py : Python (UTF-8) 08:21:59: Geany INFO : Wrote /home/bentref/Projects/pygobject/sandwich.py with g_file_set_contents(). 08:21:59: Geany INFO : /home/bentref/Projects/pygobject/sandwich.py : Python (UTF-8) 08:23:09: Geany INFO : Wrote /home/bentref/Projects/pygobject/sandwich.py with g_file_set_contents(). 08:23:09: Geany INFO : /home/bentref/Projects/pygobject/sandwich.py : Python (UTF-8)

bentref avatar Feb 27 '18 16:02 bentref

@bentref please try the symbol update setting requested above and also try running Geany with no plugins enabled to see if that fixes it.

elextr avatar Feb 27 '18 22:02 elextr

@elextr I tried both of these and neither fixed it. I did realize that I've had similar issues with Inkscape, which were fixed by resetting the preferences file, so I'll try that. I will also try doing the backtrace later, suggested by @b4n, will update with what that produces. Output will be interesting, if nothing else.

bentref avatar Feb 27 '18 23:02 bentref

to try without screwing your settings run geany -c /some_dir/something_that_does_not_exist and geany will make a default config there.

elextr avatar Feb 27 '18 23:02 elextr

@bentref are you using GNOME with X11 or Wayland?

codebrainz avatar Feb 28 '18 00:02 codebrainz

I am using it with Wayland. I will try using the X11 session instead and see if that has any impact on this Thanks @codebrainz for bringing that up, the display server is definitely a possibility for the cause of this problem.

bentref avatar Feb 28 '18 00:02 bentref

I get weird behaviour even in X11 with KDE with regards to the auto-completion popup, probably Scintilla doing something uncommon, so it made me think it's related to the auto-complete popup window.

codebrainz avatar Feb 28 '18 00:02 codebrainz

@bentref if you have Geany fullscreen, try it without, I have problems with slow updating of Scintilla on fullscreen (on X11), which appears to be related to the use of accelerated drawings methods when an app is fullscreen and no compositing is needed.

elextr avatar Feb 28 '18 01:02 elextr

if you have Geany fullscreen, try it without,

It turns out I am on X11, actually, but that didn't fix the lag. If Geany uses the Scintilla component (which I think it does), you could be getting at something, but there is still no solution.

bentref avatar Feb 28 '18 01:02 bentref

Sorry to not be clear, my problem is Scintilla in Geany updating slowly on fullscreen, but its fine if the window isn't fullscreen. The non-scintilla parts of the UI update fine AFAICT.

elextr avatar Feb 28 '18 02:02 elextr

Sorry to not be clear, my problem is Scintilla in Geany updating slowly

Interesting. So @elextr, do you consistently have the same problem as me - typing lag in editor?

What desktop are you using? - that would help explain why it has to do with fullscreen. On my GNOME, fullscreen does not seem to be a factor in this. And what fullscreen do you mean? Do you refer to maximized (as in window) or actual fullscreen, accessed via F11?

bentref avatar Feb 28 '18 04:02 bentref

Ahh yeah, maximised to be precise. Desktop is cinnamon which is a Gnome fork.

Here the current line seems to update when the cursor flashes (which makes sense) so any typing delay may not be visible. But non-current lines may take some time to update, for example on a scroll, maybe half the lines update, a delay and the rest update. And its not consistent, its like its intermittently missing an update signal, or a partly updated screen buffer is displayed and the rest of the update goes into a screen buffer that has to wait for something else to trigger moving it to the screen.

I thought there was an issue I opened on it, but maybe it was a ML conversation because I can't see any issue.

I was more pointing it out as something that might be related and might point in the right direction, than its exactly the same problem.

elextr avatar Feb 28 '18 05:02 elextr

I was more pointing it out as something that might be related and might point in the right direction, than its exactly the same problem.

It does seem to be a very similar problem, though. I consistently have typing lag, but as @elextr said, there is a big lag for me with non-current lines as well - clicking on another line, or scrolling, it takes about a second for the line highlight to move to the new line. In addition, my lag is not always reproducible and doesn't happen for every letter or scroll, similar to what you're describing. I will try running Geany in F11 fullscreen to see if that affects it.

bentref avatar Feb 28 '18 17:02 bentref

I would definitely try a fresh config dir using the -c option as @elextr mentioned. It will narrow down whether it's something with your system (window manager, gtk version, etc.) or one of the settings (ex. line-wrapping).

codebrainz avatar Mar 01 '18 01:03 codebrainz

@codebrainz I did open geany with a -c option, temporarily resetting preferences, but this did not fix the lag issue. I'm using emacs until I can fix Geany's severe lag problems.

bentref avatar Mar 01 '18 17:03 bentref

It only happens when Geany is the top layered window, so far. So the lag might be related to windowing or the GNOME Desktop.

We have basically eliminated anything that has caused that sort of lag on other systems, so yeah it comes down to your system.

Unless it happens to another contributor who can check CPU (eg by top or system monitor on another screen) and then provide backtraces there isn't anything much we can do at the moment.

elextr avatar Mar 01 '18 22:03 elextr

for checking CPU usage, what about having both windows on the screen at the same time, and having Geany's on the front? using the system monitor, top or whatnot, should be doable on most if not all but the tiniest screens.

b4n avatar Mar 01 '18 22:03 b4n

for checking CPU usage, what about having both windows on the screen at the same time, and having Geany's on the front? using the system monitor, top or whatnot, should be doable on most if not all but the tiniest screens.

Sorry it took so long to respond. I was able to do this, and according to top the CPU usage for Geany at the moments when it was lagging went between 2% and 12%. I have a Core i3-7100 @3.9ghz and everything else runs fast, so hardware is clearly not the problem.

bentref avatar Mar 25 '18 22:03 bentref

@b4n might have some ideas how you could debug GTK/Scintilla, but since nobody can reproduce your specific symptoms its hard to see how to go from here.

elextr avatar Mar 26 '18 00:03 elextr

I have exactly the same issue. And I would say it is a major issue. My environment is: Arch Linux GNOME Shell 3.26.2 geany 1.33 (generated on 2018-03-06 with GTK 3.22.28, GLib 2.54.3)

The issue is present also running geany -c /nonexistent/folder. I am encountering exactly the same problems described by @bentref. I can confirm it is not CPU related.

I am using geany since > 5 years and I have never experienced anything similar. If there is anything I can do, I'll help gladly.

dario2994 avatar Apr 02 '18 19:04 dario2994

@bentref or @dario2994 can you build Scite (the Scintilla reference editor) version 3.7.5 (to match the Scintilla used in Geany, not the latest) and see if the problem occurs there as well?

elextr avatar Apr 02 '18 21:04 elextr

@dario2994 Yes, I confirm that you are having the same issue as me and the root cause is likely the same as well, given how well the symptoms match up.

can you build Scite (the Scintilla reference editor) version 3.7.5 (to match the Scintilla used in Geany, not the latest) and see if the problem occurs there as well?

@elextr Yes, I installed Scite 3.7.5 and it has exactly the same issue as geany. Which makes sense. Slow update when going to a new line, lag when typing, etc.

bentref avatar Apr 02 '18 22:04 bentref

@bentref thanks, I don't suppose its fixed in the latest in the 3.x.x series? Unfortunately Scintilla 4 needs a C++17 compiler that is not available in many places Geany supports so we won't use it (and IIUC its not stable yet anyway).

elextr avatar Apr 02 '18 22:04 elextr

I am seeing this too on upgrade from Ubuntu 18.04 (Geany 1.32) to 18.10 (Geany 1.33)

Does this not seem to be GTK related rather than Scintilla?

cas-- avatar Nov 19 '18 11:11 cas--

Does this not seem to be GTK related rather than Scintilla?

Well it might be GTK as its used by Scintilla, since its reproducible on Scite as well.

@cas-- can you try a current Git Geany which has a more recent Scintilla?

elextr avatar Nov 19 '18 11:11 elextr

can you try a current Git Geany which has a more recent Scintilla?

Okay so I built latest git and it seems to all be fine however switching back to the distro installed version is also working fine so I think I need to leave it longer before drawing any conclusions :confused:

cas-- avatar Nov 20 '18 15:11 cas--

@cas-- thanks for trying it, sounds like maybe its some interaction with something else happening on the system?

elextr avatar Nov 20 '18 23:11 elextr