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

Enhancement request: please send binary data instead of ASCII to Gnuplot #157

Open
sergstesh opened this issue Dec 31, 2020 · 4 comments
Open
Assignees
Milestone

Comments

@sergstesh
Copy link

I've been using Gaston for a while, and in the past even looked into its source code. I discovered then that Gaston sends ASCII data to Gnuplot. This is not wrong algorithmically, but it degrades speed. Speed is degraded because Gnuplot needs to parse ASCII data; also, amount of data is greater for ASCII than for binary.

Speed is not an issue with small data sets, but for large datasets it is an issue.

With the latest Gaston version using debug mode I see:

"

┌ Gaston in function gnuplot_send
│ plot '/tmp/jl_1ESmqP' i 0 
└

",

"

cat /tmp/jl_1ESmqP
0.0     0.15865525393145707
3.010299956639812       0.07864960352514257
4.771212547196624       0.041632258331775224
6.020599913279624       0.02275013194817922
6.989700043360188       0.012673659338734138
7.781512503836437       0.007152939217714829
8.450980400142567       0.004075485796751351
9.030899869919436       0.002338867490523633
9.542425094393248       0.0013498980316300957
10.0    0.0007827011290012744
10.413926851582252      0.0004555594385768573
10.79181246047625       0.00026600275256962515
11.139433523068368      0.0001557454883836921
11.46128035678238       9.140531649091767e-5
11.760912590556813      5.375558836475028e-5

",

So data being sent to Gnuplot is still ASCII.

Format of binary data to be sent to Gnuplot is described e.g. in http://www.gnuplot.info/docs_5.2/Gnuplot_5.2.pdf starting from p86, under "BINARY DATA FILES:".

I understand that it's easier to debug ASCII than binary, so sending binary data should not necessarily be instead of ASCII, but it can be an option - especially in the early versions if they are to be implemented.

Thank in advance.

@sergstesh
Copy link
Author

And I forgot to mention that converting data from internal binary representation into ASCII in Julia interpreter also takes time.

@mbaz
Copy link
Owner

mbaz commented Dec 31, 2020

@sergstesh Thanks for the suggestion. It is a good idea, and you're likely correct that this will improve speed, especially for plots with lots of data. I will try to get this done for v1.1 (a PR would be very welcome, too!).

@mbaz mbaz added this to the 1.1.0 milestone Dec 31, 2020
@mbaz mbaz self-assigned this Dec 31, 2020
@sergstesh
Copy link
Author

What is "PR" in this case ?

@mbaz
Copy link
Owner

mbaz commented Dec 31, 2020

@sergstesh A "pull request", meaning that you (or someone else) works on the code to implement this, and then requests me to "pull" their code into Gaston.jl. See https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/proposing-changes-to-your-work-with-pull-requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants