ProfileView.jl icon indicating copy to clipboard operation
ProfileView.jl copied to clipboard

Importing ProfileView slows down keyboard input and crashes AutoHotkey

Open tfiers opened this issue 2 years ago • 5 comments

I'm on Windows 10, Julia 1.7.0.

Running using ProfileView (after it's installed in the current env, v1.5.1) makes the keyboard unresponsive or very slow to respond, for about 30 seconds after the command has returned. In addition, if have an AutoHotkey script running during the import command, the script stops working and I have to restart it.

It's not a big issue; I'm just posting this here for if there are other Julia users with this problem and wondering where it comes from (I had a large list of packages imported, and by elimination narrowed the problem down to ProfileView).

edit: still in Julia 1.8.1

tfiers avatar Jun 13 '22 13:06 tfiers

I can verify this, and I'd call it a big issue. Does it happen for you with using Gtk?

timholy avatar Sep 24 '22 06:09 timholy

It does indeed.

Seems like it is downstream and known:

  • https://github.com/JuliaGraphics/Gtk.jl/issues/629
  • https://github.com/JuliaGraphics/Gtk.jl/issues/325
  • https://gitlab.gnome.org/GNOME/gtk/-/issues/2015 "Gdk-Win32 backend installs a low level keyboard hook at startup" → this is what messes with AutoHotkey I suppose

tfiers avatar Sep 27 '22 11:09 tfiers

As suggested by @jwahlstrand, having ENV["GTK_AUTO_IDLE"] = false before importing fixes it.

tfiers avatar Sep 28 '22 14:09 tfiers

This issue also appears in julia 1.9.2, https://discourse.julialang.org/t/profileview-jl-makes-my-computer-lag/ ENV["GTK_AUTO_IDLE"] = false still works. I think however we should not do this manually. The fix itself is not a big deal, but imagine your keyboard being super laggy and nearly un-usable and you don't know why. Users spend a few hours until they figure out is ProfileView/Gtk. Is it possible for ProfileView to automatically call ENV["GTK_AUTO_IDLE"] = false when using it? (only on windows machines)

Edit: If I think better ENV["GTK_AUTO_IDLE"] = false shall be done in the Gtk package, not inside ProfileView.

MariusDrulea avatar Aug 09 '23 22:08 MariusDrulea

https://github.com/JuliaGraphics/Gtk.jl/pull/692 may fix it once and for all

timholy avatar Aug 10 '23 17:08 timholy