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

Reworked subset.c #3170

Merged
merged 2 commits into from
Dec 1, 2018
Merged

Reworked subset.c #3170

merged 2 commits into from
Dec 1, 2018

Conversation

mattdowle
Copy link
Member

@mattdowle mattdowle commented Nov 30, 2018

subset.c complete for #3165. Other files still to review.
Removed all R API use in parallel regions.
Removing the catch-and-expand ALTREP. That's left to R which will do that inside INTEGER(), REAL() etc when they see ALTREP vecs (which is now ok as those R API calls are now outside parallel regions).
Parallel within column rather than across columns: A very big subset of 1 column should benefit from 8 cores now, whereas before that was single threaded.
No critical or anything complicated. Simpler.
Tighter branch-free loops by dealing with zeros and negatives up-front.
Also makes progress in being able to stop defining USE_RINTERNALS : should not be needed for this file now either to work or for performance.

@mattdowle mattdowle added this to the 1.12.0 milestone Nov 30, 2018
@codecov
Copy link

codecov bot commented Nov 30, 2018

Codecov Report

Merging #3170 into master will decrease coverage by 0.1%.
The diff coverage is 88.97%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3170      +/-   ##
==========================================
- Coverage   92.18%   92.08%   -0.11%     
==========================================
  Files          61       61              
  Lines       11587    11583       -4     
==========================================
- Hits        10682    10666      -16     
- Misses        905      917      +12
Impacted Files Coverage Δ
src/init.c 93.65% <ø> (ø) ⬆️
R/data.table.R 92.74% <100%> (-0.01%) ⬇️
src/subset.c 91.62% <88.88%> (-5.64%) ⬇️
src/uniqlist.c 95% <0%> (-0.56%) ⬇️
src/assign.c 94.57% <0%> (-0.17%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2b1853...70df324. Read the comment docs.

@codecov
Copy link

codecov bot commented Nov 30, 2018

Codecov Report

Merging #3170 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3170      +/-   ##
==========================================
+ Coverage   92.18%   92.21%   +0.02%     
==========================================
  Files          61       61              
  Lines       11587    11578       -9     
==========================================
- Hits        10682    10677       -5     
+ Misses        905      901       -4
Impacted Files Coverage Δ
src/init.c 93.65% <ø> (ø) ⬆️
R/data.table.R 92.74% <100%> (-0.01%) ⬇️
src/subset.c 100% <100%> (+2.74%) ⬆️
src/assign.c 94.57% <0%> (-0.17%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2b1853...1847500. Read the comment docs.

@mattdowle mattdowle merged commit 6054d7f into master Dec 1, 2018
@mattdowle mattdowle deleted the dataptr branch December 1, 2018 00:47
// Only for use by subsetDT() or subsetVector() below, hence static
{
if (!length(target)) return target;
const int n = length(idx);
if (length(ans)!=n) error("Internal error: subsetVectorRaw length(ans)==%d n=%d", length(ans), n);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be nocov here

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.

2 participants