Skip to content

Conversation

@ben-schwen
Copy link
Member

@ben-schwen ben-schwen commented Jan 5, 2026

Closes #712
Should probably follow #7401

Timings from issue

DT <- data.table(x=rep(1:1e7, 2L), y=1L)
microbenchmark::microbenchmark(times = 50L, DT[, .N, by=x], DT[, list(N = .N), by=x])
# Unit: milliseconds
#                        expr      min       lq     mean   median       uq      max neval
#            DT[, .N, by = x] 251.0772 284.3042 297.7992 293.8167 306.1571 356.7400    50
#  DT[, list(N = .N), by = x] 245.8979 286.3050 299.6035 295.5314 304.7920 369.8054    50

dd <- data.table(x=1:1e6,key="x")
microbenchmark::microbenchmark(times = 50L, 
    dd[dd, 1, by = .EACHI],
    dd[dd, list(1), by = .EACHI]
)

# Unit: milliseconds
#                          expr      min       lq     mean   median       uq      max neval
#        dd[dd, 1, by = .EACHI] 203.6271 208.2239 212.7361 209.5664 217.1072 241.5754    50
#  dd[dd, list(1), by = .EACHI] 204.4147 206.8032 212.0772 210.9118 215.1693 241.4883    50

microbenchmark::microbenchmark(times = 50L, 
    dd[dd, x, by = .EACHI],
    dd[dd, list(x), by = .EACHI]
)

# Unit: milliseconds
#                          expr      min       lq     mean   median       uq      max neval
#        dd[dd, x, by = .EACHI] 259.9601 263.3664 271.2088 267.9141 278.3005 290.7164    50
#  dd[dd, list(x), by = .EACHI] 257.3253 264.2222 272.0825 270.7082 277.3748 307.8739    50

@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.00%. Comparing base (0216983) to head (7f8dbdd).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7565   +/-   ##
=======================================
  Coverage   99.00%   99.00%           
=======================================
  Files          87       87           
  Lines       16893    16902    +9     
=======================================
+ Hits        16725    16734    +9     
  Misses        168      168           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link

github-actions bot commented Jan 5, 2026

  • HEAD=optimize_listVar slower P<0.001 for memrecycle regression fixed in #5463
    Comparison Plot

Generated via commit 079f000

Download link for the artifact containing the test results: ↓ atime-results.zip

Task Duration
R setup and installing dependencies 2 minutes and 48 seconds
Installing different package versions 43 seconds
Running and plotting the test cases 4 minutes and 4 seconds

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.

j=list(var) slower than j=var, with by=

1 participant