-
Notifications
You must be signed in to change notification settings - Fork 80
Conversation
Can we have a more neutral warning. "Buggy" has negative meaning IMHO. |
Codecov Report
@@ Coverage Diff @@
## master #467 +/- ##
==========================================
+ Coverage 49.5% 49.64% +0.14%
==========================================
Files 32 32
Lines 2135 2137 +2
==========================================
+ Hits 1057 1061 +4
+ Misses 1078 1076 -2
Continue to review full report at Codecov.
|
ok, thanks. |
I assume there is no fix for this on the horizon? |
I seem to remember that Jameson suggested to replace a number with another number somewhere, but that's lost in slack history - or I completely dreamt this. |
Maybe this has happened, since the problem got ~30x better (it's still immediately noticeable though :( ) |
This seems likely to be due to polling, so I'm guessing some constants here or here might be relevant. In the first one, maybe try changing that 100 to 1000 and see if it gets better? I can't easily test this myself, I do have a virtualbox Windows install (if it can be replicated on that platform) but I'm stymied currently by #461. |
Yes, I think it was one of those numbers.
Doesn't adding |
That fixes it, thanks. I can replicate the REPL lag but not the Empirically, changing the |
My understanding (based on this comment) of the issue is that in order not to block the REPL with it's main loop Gtk.jl does some funny business with julia Tasks, which doesn't work very well on Windows. I'm not sure if that's a fundamental issue or it can be fixed by tweaking things up a bit. But maybe with the new thread system all this could be redesigned (run Gtk main loop in a thread instead of a task ?). The issue is that we need someone that understand Julia's tasks, threads, Gtk and has time to look at it, which is probably not many people, if any. |
This warning seems to cause a great deal of stress for some people: https://discourse.julialang.org/t/image-in-repl-does-not-correct/46359/5. Not sure what to do here. |
Remove the warning? |
And if you changes from 100 to 10 and see an improvement, may just change that? |
I just tested the newest Gtk on 1.5.1 and the REPL slowdown is still significant, and will still be very confusing if a random Package has a silent dependency on Gtk. |
Let's try dropping that constant but leave the warning. I tried naively putting the event loop in a thread: diff --git a/src/Gtk.jl b/src/Gtk.jl
index f633bda..a89ff40 100644
--- a/src/Gtk.jl
+++ b/src/Gtk.jl
@@ -38,6 +38,8 @@ using Cairo
import Cairo: destroy
using Serialization
+using ThreadPools
+
const Index{I<:Integer} = Union{I, AbstractVector{I}}
export GAccessor
@@ -138,7 +140,11 @@ function __init__()
# if g_main_depth > 0, a glib main-loop is already running,
# so we don't need to start a new one
if ccall((:g_main_depth, GLib.libglib), Cint, ()) == 0
- global gtk_main_task = schedule(Task(gtk_main))
+ if Threads.nthreads() > 1
+ global gtk_main_task = @tspawnat Threads.nthreads() gtk_main()
+ else
+ global gtk_main_task = schedule(Task(gtk_main))
+ end
end
end but I got deadlocks. I do not plan to dig into Gtk internals enough to understand how to fix that, sorry. |
@SimonDanisch, can you try changing 100 to 10 here? Line 300 in d7b1ef8
|
I'm going to submit that change but let's give Simon a chance to test before merging. |
Can we please, please leave this warning? Debugging this problem can waste days of frustrating debugging, even for experienced Julia developers, as you can see here: https://discourse.julialang.org/t/serious-issue-julia-language-keyboard-lag-typing-very-slow/32081/23
A package, which turns calculating a simple spectrogram from 0.02s to 1.7s (it's actually not as bad anymore, it was 50s before 1.1.0) just by using it anywhere in the dependency stack definitely needs to be warned about.