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

lowertriangle() could be faster with memory preallocation #322

Closed
vlepori opened this issue Apr 30, 2020 · 2 comments
Closed

lowertriangle() could be faster with memory preallocation #322

vlepori opened this issue Apr 30, 2020 · 2 comments
Milestone

Comments

@vlepori
Copy link
Contributor

vlepori commented Apr 30, 2020

I was tinkering with the package functions (needed a matrix scatterplot with continuous variable color aesthetic) and saw that lowertriangle() generates the expanded dataframes for plots by growing a df inside a nested loop.
This seems inefficient and unnecessary, since we know the final dimension of the output. So I made a version of the function with memory preallocation, and it is notably faster with larger data.
image
The actual plotting might still take the most time, but if there is interest I'd be happy to share the code or make a PR. Thanks for the nice package!

@schloerke
Copy link
Member

oh goodness. Good find @vlepori ! A PR is always welcome!

vlepori added a commit to vlepori/ggally that referenced this issue May 15, 2020
As per ggobi#322, rewrote the loop to first allocate the df and then fill it rather than rbind()
@schloerke schloerke added this to the 2.0.0 milestone May 19, 2020
schloerke pushed a commit that referenced this issue May 27, 2020
As per #322, rewrote the loop to first allocate the df and then fill it rather than rbind()
@schloerke
Copy link
Member

Fixed in #328

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

No branches or pull requests

2 participants