Skip to content

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

Open

Description

@arunsrinivasan
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

Activity

  1. added this to the v1.9.8 milestone on Nov 26, 2014
  2. modified the milestones: , v1.9.8 on Apr 10, 2016
  3. removed this from the milestone on May 10, 2018
  4. added
    GForce
    on Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GForcefeature requestperformance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions