Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to gtk-renderer as default #173

Closed
wants to merge 2 commits into from
Closed

switch to gtk-renderer as default #173

wants to merge 2 commits into from

Conversation

vtjnash
Copy link
Collaborator

@vtjnash vtjnash commented Sep 17, 2014

It's about time we switch to a more modern toolkit :)

(I just closed the issue JuliaGraphics/Gtk.jl#103 regarding installing Gtk.jl on a Mac automatically)

@tknopp
Copy link
Collaborator

tknopp commented Sep 17, 2014

+1

This would give us more widespread adoption of Gtk and one can potentially also think about depending on it for layout stuff (e.g. a color bar beside an image).

@lobingera
Copy link

For layout things, i'm wondering for some time if Compose.jl could be a candiate.

@natj
Copy link
Contributor

natj commented Sep 20, 2014

There was some discussion about the layout things in #125

@nolta
Copy link
Member

nolta commented Sep 20, 2014

I'm hesitant to merge this because, at least on my laptop, using Winston goes from 15s to 24s.

@timholy
Copy link
Member

timholy commented Sep 20, 2014

@nolta, agreed that this is a problem, but OTOH...Gtk.jl precompiles nicely with the userimg.jl mechanism, Tk.jl (in my experience) does not. That would make Winston much faster than it is now.

So it's a bit of dilemma. Obviously users can tweak this themselves. FWIW ImageView is going to make the switch.

@vtjnash
Copy link
Collaborator Author

vtjnash commented Sep 24, 2014

@nolta i made a few fixes to avoid compiling some functions in Gtk in order to drop the load time substantially (in particular, Base.enumerate and Base.subtypes). on my machine, this reduces the time for loading Gtk from ~16s to ~7s (~2s for GLib, ~2.5s for Color, ~0.5s for Cairo, & ~2.5s for Gtk proper)

@timholy
Copy link
Member

timholy commented Sep 24, 2014

Amazing!

@nolta
Copy link
Member

nolta commented Sep 25, 2014

That's great -- it's a lot faster now. But tk seems to have gotten faster too? My using Winston times are now 9s for tk vs 13s for gtk.

@vtjnash
Copy link
Collaborator Author

vtjnash commented Sep 26, 2014

yes, it seems Tk loads in just over a second on my machine. whereas it takes julia over a second just to load all of the function definitions in the GAccessors cache file alone. this is simply a matter of Gtk providing so much more functionality

does it sound hopeless yet?

nah, just time for some more tricks to close the gap. here's a sneak peak at a performance improvement I'm attempting that is a simple one-liner to enable for any given module:

julia> @time reload("Cairo")
elapsed time: 2.609185641 seconds (77368284 bytes allocated) #about 0.5 s faster

julia> @time reload("Gtk")
elapsed time: 2.834629372 seconds (71012208 bytes allocated) # about 2 s faster

(and actually, there's another ~1s improvement I could add to Gtk, but it would hit a bug in base and segfault, so I'm still working on that one)

edit: I removed some special cases in Gtk, so that I could avoid the segfault, while making a few more tweaks so the net result would be to remove a few more ms. this is without a userimg.jl file, but with adding an extra line of code to Winston, Cairo, Color, and Gtk:

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.0-dev+778 (2014-09-26 04:05 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit f8816b2* (0 days old master)
|__/                   |  x86_64-apple-darwin13.3.0

julia> @time reload("Winston")
elapsed time: 7.438725029 seconds (269089352 bytes allocated, 1.24% gc time)

julia> Winston.output_surface
:gtk

(yesterday, this would have read elapsed time: 10.193163448 seconds (215723604 bytes allocated, 0.70% gc time))

@tknopp
Copy link
Collaborator

tknopp commented Apr 22, 2019

this already happened

@tknopp tknopp closed this Apr 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants