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

GForce should kick in when i is present as well... #971

Open
1 of 2 tasks
arunsrinivasan opened this issue Nov 26, 2014 · 0 comments
Open
1 of 2 tasks

GForce should kick in when i is present as well... #971

arunsrinivasan opened this issue Nov 26, 2014 · 0 comments
Labels
feature request GForce issues relating to optimized grouping calculations (GForce) performance

Comments

@arunsrinivasan
Copy link
Member

require(data.table) # 1.9.5, R v3.1.2
DT = data.table(x=c(1,1,1,2,2,3,3,3), y=1:8)
options(datatable.verbose=TRUE)

# GForce kicks in
DT[, mean(y),by=x]
# Detected that j uses these columns: y 
# Finding groups (bysameorder=FALSE) ... done in 0secs. bysameorder=TRUE and o__ is length 0
# lapply optimization is on, j unchanged as 'mean(y)'
# GForce optimized j to 'gmean(y)'
#    x  V1
#1: 1 2.0
#2: 2 4.5
#3: 3 7.0

# GForce doesn't
DT[x > 1L, mean(y), by=x]
# i clause present and columns used in by detected, only these subset: x 
# Detected that j uses these columns: y 
# Finding groups (bysameorder=FALSE) ... done in 0secs. bysameorder=TRUE and o__ is length 0
# lapply optimization is on, j unchanged as 'mean(y)'
# Old mean optimization changed j from 'mean(y)' to '.External(Cfastmean, y, FALSE)'
# Starting dogroups ... 
#   collecting discontiguous groups took 0.000s for 2 groups
#   eval(j) took 0.000s for 2 calls
# done dogroups in 0 secs
#    x  V1
#1: 2 4.5
#2: 3 7.0
  • subsets in i
  • joins in i
@arunsrinivasan arunsrinivasan added this to the v1.9.8 milestone Nov 26, 2014
@arunsrinivasan arunsrinivasan modified the milestones: v2.0.0, v1.9.8 Apr 10, 2016
@mattdowle mattdowle removed this from the Candidate milestone May 10, 2018
@MichaelChirico MichaelChirico added the GForce issues relating to optimized grouping calculations (GForce) label Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request GForce issues relating to optimized grouping calculations (GForce) performance
Projects
None yet
Development

No branches or pull requests

3 participants