-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPerformance Drop3395.Rmd
82 lines (73 loc) · 2.61 KB
/
Performance Drop3395.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
81
82
---
title: "Performance"
author: "Doris Amoakohene"
date: "`r Sys.Date()`"
output: html_document
---
Performance drop with 1.12.0 (Selection + assignment)
#3395
https://github.com/Rdatatable/data.table/issues/3395
```{r}
library(atime)
library(data.table)
library(ggplot2)
library(git2r)
```
```{r}
tdir <- tempfile()
dir.create(tdir)
git2r::clone("https://github.com/Rdatatable/data.table", tdir)
```
```{r}
atime.list <- atime::atime_versions(
pkg.path=tdir,
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_day <- 60
n_clientid <- 1e5
n_Platform <- 7
X <- data.table(
day = sample(1:n_day, N, TRUE),
clientid = as.character(sample(1:n_clientid, N, TRUE)),
Platform = as.character(sample(1:n_Platform, N, TRUE))
)
},
expr=data.table:::`[.data.table`( X(, .(x = uniqueN(day) - 1L,
first_active_day = min(day),
last_active_day = max(day)),
by = .(Platform, clientid)),
"Before"="5b6ded1fbd4d480a5f854470b9696d09b9fb6dd9",#https://github.com/Rdatatable/data.table/tree/5b6ded1fbd4d480a5f854470b9696d09b9fb6dd9
"Regression"="662d165246bba60877af84550689416ffb06584d", #https://github.com/Rdatatable/data.table/tree/662d165246bba60877af84550689416ffb06584d
"Fixed"="324b4b2a7b080cc98c9982ef4a77260392d5f32b") #fixed:https://github.com/Rdatatable/data.table/tree/324b4b2a7b080cc98c9982ef4a77260392d5f32b