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

Optimize RDAIO #759

Merged
merged 4 commits into from
Jan 6, 2015
Merged

Optimize RDAIO #759

merged 4 commits into from
Jan 6, 2015

Conversation

alyst
Copy link
Contributor

@alyst alyst commented Jan 5, 2015

Another round of RDA performance polishing:

  1. Make long R vectors support optional. Disable by default on 32-bit systems (it's unlikely many people work with big dataframes on 32-bit systems, and in all other cases iterating over Int64 variable just slows everything down), R does the same.
  2. Get >20% improvement in time and memory by improving type inference of IO variable. Before:
[~]$ julia -e "using DataFrames; @time read_rda(\"test.RData\")"
elapsed time: 15.414509979 seconds (2433718088 bytes allocated, 5.44% gc time)

after

[~]$ julia -e "using DataFrames; @time read_rda(\"test.RData\")"
elapsed time: 12.278712969 seconds (1834821860 bytes allocated, 3.38% gc time)

alyst added 4 commits January 5, 2015 20:13
from network (big-endian) IO stream to host (ntoh), not hton
improves type inference in atomic reads,
performance and memory allocation
on 32-bit versions supporting long vectors might slow down RDA reading
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling e6fc839 on alyst:optimize_RDAIO into 0f21922 on JuliaStats:master.

@garborg
Copy link
Contributor

garborg commented Jan 6, 2015

Thanks, @alyst.

What did you find out on the NaN/NA swap we're seeing for ASCII data?

garborg added a commit that referenced this pull request Jan 6, 2015
@garborg garborg merged commit 99be77f into JuliaData:master Jan 6, 2015
@alyst
Copy link
Contributor Author

alyst commented Jan 6, 2015

@garborg For ASCII/ASCIIhex output they just output NA if ISNAN(d) is true and that discards NA/NaN distinction, whereas for XDR/native binary formats they write the real as is. I guess it's a rather long standing R bug, but I didn't found any discussion/bug reports.

@garborg
Copy link
Contributor

garborg commented Jan 6, 2015

Ah, interesting, I understand the comment in the tests now. Thanks for expanding.

@alyst
Copy link
Contributor Author

alyst commented Jan 6, 2015

Filed R-project bug 16137.

@garborg
Copy link
Contributor

garborg commented Jan 6, 2015

Nice!

@StefanKarpinski
Copy link
Member

It's kind of amazing that our issue counter is rapidly catching up to the R project.

nalimilan pushed a commit that referenced this pull request May 26, 2022
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.

4 participants