add shared guard for setkey#7769
Draft
ben-schwen wants to merge 1 commit into
Draft
Conversation
|
Generated via commit 1d17aaa Download link for the artifact containing the test results: ↓ atime-results.zip
|
Member
|
Part of the problem here is that it's too easy for data.table columns to accumulate a large reference count due to we use shallow copies: x <- as.data.table(copy(mtcars))
.Internal(inspect(x, 1))
# @55bf23a15f20 19 VECSXP g0c7 [OBJ,REF(1),gp=0x20,ATT] (len=11, tl=1035)
# @55bf262bdbf0 14 REALSXP g0c7 [REF(4)] (len=32, tl=0) 21,21,22.8,21.4,18.7,...
# @55bf23cc0f60 14 REALSXP g0c7 [REF(4)] (len=32, tl=0) 6,6,4,6,8,...
# @55bf23cc17d0 14 REALSXP g0c7 [REF(4)] (len=32, tl=0) 160,160,108,258,360,...
# @55bf23d49d40 14 REALSXP g0c7 [REF(4)] (len=32, tl=0) 110,110,93,110,175,...
# @55bf239f09a0 14 REALSXP g0c7 [REF(4)] (len=32, tl=0) 3.9,3.9,3.85,3.08,3.15,...
x[,mean(mpg),by=.(gear,carb)]
.Internal(inspect(x, 1))
# @55bf23a15f20 19 VECSXP g0c7 [OBJ,REF(3),gp=0x20,ATT] (len=11, tl=1035)
# @55bf262bdbf0 14 REALSXP g0c7 [REF(6)] (len=32, tl=0) 21,21,22.8,21.4,18.7,...
# @55bf23cc0f60 14 REALSXP g0c7 [REF(5)] (len=32, tl=0) 6,6,4,6,8,...
# @55bf23cc17d0 14 REALSXP g0c7 [REF(5)] (len=32, tl=0) 160,160,108,258,360,...
# @55bf23d49d40 14 REALSXP g0c7 [REF(5)] (len=32, tl=0) 110,110,93,110,175,...
# @55bf239f09a0 14 REALSXP g0c7 [REF(5)] (len=32, tl=0) 3.9,3.9,3.85,3.08,3.15,...So far, the guidance from above was to clean up our temporary shallow copies by hand in order to lower the reference counts on the columns. |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #5230