I have now a minimal example that shows the issue:
using Gtk.ShortNames
ENV["WINSTON_OUTPUT"] = :gtk
using Winston
box = Box(:v)
b = Button("test")
push!(box,b)
c = Canvas()
push!(box,c)
setproperty!(box,:expand,c,true)
w = Window(box,"Test")
function callback(widgetptr::Ptr, m::Ptr)
p = Winston.plot(1:5)
display(c,p)
return nothing
end
@time signal_connect(callback, b, "clicked", Void, (), false, C_NULL )
showall(w)
Here, the signal_connect requires more than 10 seconds on julia 0.6.0 and about 5 seconds on julia 0.6.3.
@jameson: You have proposed using a schedule in the callback
using Gtk.ShortNames
ENV["WINSTON_OUTPUT"] = :gtk
using Winston
box = Box(:v)
b = Button("test")
push!(box,b)
c = Canvas()
push!(box,c)
setproperty!(box,:expand,c,true)
w = Window(box,"Test")
function callback(widgetptr::Ptr, m::Ptr)
@schedule begin
p = Winston.plot(1:5)
display(c,p)
end
return nothing
end
@time signal_connect(callback, b, "clicked", Void, (), false, C_NULL )
showall(w)
Now the signal connection is faster (0.6 sec) but when I click the button it requires 5 seconds. And the UI is frozen during that time.
If you or anybody else has an idea how to solve this it would be great. I suppose that the new multi-threaded task manager will solve the UI freeze?
But this still does not solve the Winston slowness ( https://github.com/JuliaLang/julia/issues/27083) which was fast once upon a time. Will be very interesting how fast Winston is on Julia 0.7 (https://github.com/JuliaGraphics/Winston.jl/pull/292)