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

Suggestion[s] #131

Closed
wants to merge 1 commit into from
Closed

Suggestion[s] #131

wants to merge 1 commit into from

Conversation

PallHaraldsson
Copy link

[skip ci]

[skip ci]
@mbaz
Copy link
Owner

mbaz commented Apr 16, 2020

Thanks for the suggestion! I will apply this before the next release.

@PallHaraldsson
Copy link
Author

On that suggestion:

A. When gnuplot is not installed, trying to invoke in in the shell gives three options. And only gnuplot-qt works. I tried gnuplot-x11 first (seemed logical and could also have guessed the other, gnuplot-nox was the only other option given). If you install gnuplot, you get the right one, unless you've already installed the wrong one.

I'm not sure about other platforms.

B. Congratulations on the package, it may be the fastest one (only under a second to first plot?), and still you're not happy, I would suggest relaxing to say half a second:

julia> @time using Gaston
  0.648171 seconds (1.04 M allocations: 52.887 MiB, 1.18% gc time)

julia> @time using Gaston # with -O0, that possibly could/should be hardcoded into the code as done for Plots.jl (it used -O1, almost as fast at compiling, probably better at runtime?)
  0.505364 seconds (1.04 M allocations: 52.890 MiB, 1.40% gc time)


julia> @time plot(randn(10^6),randn(10^6))
  0.386259 seconds (144.02 k allocations: 22.747 MiB, 1.73% gc time)
Error showing value of type Gaston.Figure:
ERROR: Gnuplot is taking too long to respond.
Stacktrace:
 [1] error(::String) at ./error.jl:33
[..]

julia> @time plot(randn(10^6),randn(10^6))  # with -O1, also with error
  0.313391 seconds (144.02 k allocations: 22.747 MiB, 2.02% gc time)

It's not quote under 1 sec. with all startup overhead (I saw this suggested way to time on discourse, without -O0):

$ time julia-1.5-DEV.360/bin/julia -e 'using Gaston; plot(randn(10^6), randn(10^6))' -O0

real	0m1.107s
user	0m1.388s
sys	0m0.598s

at least on my machine (maybe too loaded).

@PallHaraldsson
Copy link
Author

On your machine the above is maybe under 1 sec. I have (and didn't test without) on startup: "Warning: Could not load Revise."

Interestingly your package is much faster than the competing/alternative (not sure why both?):

julia> @time using Gnuplot; x = 1.:20;
  1.803377 seconds (990.33 k allocations: 62.218 MiB)

julia> @time @gp x x.^2 "with lines title 'Parabola'"
  4.651456 seconds (10.38 M allocations: 485.725 MiB, 7.72% gc time)

This evens out after first plot (and for all (plotting) packages, not just for gnuplot I think), so you only get the "ERROR: Gnuplot is taking too long to respond." once.

I would still, again suggest relaxing the timeout. Maybe for all plots (I tried to look into the code and almost figured out, but you'll be better at fixing?), or even better a more relaxed timout for only the first plot that needs it?

@mbaz
Copy link
Owner

mbaz commented Apr 16, 2020

Thanks a lot for the data and the comments! Lots of things to look into.

Interestingly your package is much faster than the competing/alternative

One difference is that Gnuplot.jl is not precompiled, while Gaston is. That would account for at least a few seconds.

@PallHaraldsson PallHaraldsson changed the title Suggestions[s] Suggestion[s] Apr 18, 2020
This was referenced Apr 18, 2020
@PallHaraldsson
Copy link
Author

I thought you liked to know I got time to plot under 0.28 sec with your package. So it's the fastest package I know of, or have tested, while I've tested some other very fast too with the same trick (not yet tried for all I benchmarked previously), see here:

gcalderone/Gnuplot.jl#27 (comment)

You've yet to merge the PR here, which seems uncontroversial to do. And opt. trick could be added (and precompile dropped as default anyway), but it goes only half way so, --compile=min needs currently be manual, and you might want to add a hint in the README.

@mbaz
Copy link
Owner

mbaz commented May 24, 2020

@PallHaraldsson Indeed I'm glad Gaston is so fast. Of course, a lot of the credit should go to gnuplot itself.

I've been working a lot on Gaston lately, and I'm getting close to a new release, probably 1.0. When the code is done, I'll move on to documentation, and then I'll merge your PR.

@mbaz
Copy link
Owner

mbaz commented Jun 6, 2020

I am closing this PR:

  • I added the suggestions on gnuplot-qt to the docs, with more details.
  • My plan for 1.1.0 is to make Gaston faster, by reducing inference time.

Thanks for the PR and the suggestions!

@mbaz mbaz closed this Jun 6, 2020
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.

2 participants