FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

remove allocNAVector in melt for memory efficiency by tdhock · Pull Request #5054 · Rdatatable/data.table · GitHub

remove allocNAVector in melt for memory efficiency - #5054

Merged
mattdowle merged 5 commits into
masterfrom
melt-narm-without-allocating-NA
Jun 26, 2021
Merged

mattdowle merged 5 commits into
masterfrom
melt-narm-without-allocating-NA

Conversation

tdhock commented Jun 26, 2021

Copy link
Copy Markdown
Member

While hacking various improvements to melt recently, I noticed that there were un-necessary allocations of temporary vectors of missing values via allocNAVector, when there are missing input columns. In this PR I propose to make melt more memory efficient by replacing those temporary NA vectors with NULL/R_NilValue which serves as a signal to either (1) do nothing if na.rm=TRUE, or (2) use writeNA on the output vector if na.rm=FALSE. There are no changes to user-facing functionality, but hopefully melt should be more efficient when there are missing input columns.

tdhock requested a review from mattdowle June 26, 2021 03:37
mattdowle added this to the 1.14.1 milestone Jun 26, 2021
mattdowle merged commit ed72e39 into master Jun 26, 2021
mattdowle deleted the melt-narm-without-allocating-NA branch June 26, 2021 16:11
jangorecki modified the milestones: 1.14.9, 1.15.0 Oct 29, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL