-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathby group performance.Rmd
81 lines (69 loc) · 2.55 KB
/
by group performance.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
title: 'by group performance #4655'
author: "Doris Amoakohene"
date: "`r Sys.Date()`"
output: html_document
---
```{r}
#https://github.com/Rdatatable/data.table/pull/4655
#closes
#https://github.com/Rdatatable/data.table/issues/4646
#https://github.com/Rdatatable/data.table/pull/4655/commits
#fixes by
#https://github.com/Rdatatable/data.table/pull/4655
```
```{r}
library(atime)
library(data.table)
library(ggplot2)
library(git2r)
```
```{r}
atime.list <- atime::atime_versions(
pkg.path="C:/Users/Doris Afriyie/data.table",
pkg.edit.fun=function(old.Package, new.Package, sha, new.pkg.path){
pkg_find_replace <- function(glob, FIND, REPLACE){
atime::glob_find_replace(file.path(new.pkg.path, glob), FIND, REPLACE)
}
Package_regex <- gsub(".", "_?", old.Package, fixed=TRUE)
Package_ <- gsub(".", "_", old.Package, fixed=TRUE)
new.Package_ <- paste0(Package_, "_", sha)
pkg_find_replace(
"DESCRIPTION",
paste0("Package:\\s+", old.Package),
paste("Package:", new.Package))
pkg_find_replace(
file.path("src","Makevars.*in"),
Package_regex,
new.Package_)
pkg_find_replace(
file.path("R", "onLoad.R"),
Package_regex,
new.Package_)
pkg_find_replace(
file.path("R", "onLoad.R"),
sprintf('packageVersion\\("%s"\\)', old.Package),
sprintf('packageVersion\\("%s"\\)', new.Package))
pkg_find_replace(
file.path("src", "init.c"),
paste0("R_init_", Package_regex),
paste0("R_init_", gsub("[.]", "_", new.Package_)))
pkg_find_replace(
"NAMESPACE",
sprintf('useDynLib\\("?%s"?', Package_regex),
paste0('useDynLib(', new.Package_))
},
N=10^seq(3,8),
setup={
n <- 500L
set.seed(123L)
n_nested = 40L
dt = data.table(id = seq_len(n),
value = replicate(n, data.table(val1 = sample(n_nested)), simplify = FALSE))
},#https://github.com/Rdatatable/data.table/issues/4646
expr=data.table:::`[.data.table`(dt[seq_len(.N), value[[1L]], by = id]
,dt[, value[[1L]], by = id]),
"Before"="8e78a309f75e724ff6eda219b8f2ad172a01f8e4",#https://github.com/Rdatatable/data.table/pull/4655/commits/8e78a309f75e724ff6eda219b8f2ad172a01f8e4
"Regression"="06c43b102f4b97ec91cb14a0c1631f771a9a0414", #https://github.com/Rdatatable/data.table/tree/06c43b102f4b97ec91cb14a0c1631f771a9a0414
"Fixed"="ec041f78691f9f9495c0f25b78109cd3f5295f4f") #fixed:#https://github.com/Rdatatable/data.table/tree/ec041f78691f9f9495c0f25b78109cd3f5295f4f. for fixed.
```