From b2aceb562b37d58fbcede984e28318e3d8495137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rasmus=20Skytte=20Randl=C3=B8v?= Date: Tue, 23 Jul 2024 12:38:51 +0200 Subject: [PATCH] Revert "Merge pull request #138 from ssi-dk/feature/benchmark_vignette" This reverts commit a96f13ae6a5b645efd56afa8b9baffbdaa23aa4d, reversing changes made to d5b46f93ac5f6a8695ddf3e9dc7bee60aa0cdd40. --- DESCRIPTION | 2 - NEWS.md | 3 - inst/WORDLIST | 1 - inst/extdata/benchmarks.rds | Bin 2111 -> 0 bytes pak.lock | 221 +++++++++++++++++++++++++++++++++--- vignettes/benchmarks.Rmd | 104 ----------------- 6 files changed, 207 insertions(+), 124 deletions(-) delete mode 100644 inst/extdata/benchmarks.rds delete mode 100644 vignettes/benchmarks.Rmd diff --git a/DESCRIPTION b/DESCRIPTION index 8559307f..cd07440a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -42,8 +42,6 @@ Suggests: callr, conflicted, duckdb, - ggplot2, - here, jsonlite, knitr, lintr, diff --git a/NEWS.md b/NEWS.md index 180a8942..36980e06 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,9 +6,6 @@ * `get_tables()` now returns catalog on DuckDB backends (#145). -## Documentation - -* A vignette including benchmarks of `update_snapshot()` across various backends is added (#138) # SCDB 0.4.0 diff --git a/inst/WORDLIST b/inst/WORDLIST index 1f1d3bc7..ab331f9b 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -71,7 +71,6 @@ sql SQLiteConnections SSI Statens -summarises Sys tbl diff --git a/inst/extdata/benchmarks.rds b/inst/extdata/benchmarks.rds deleted file mode 100644 index e8479b87705bfbbe6051a23420b756f789864c46..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2111 zcmV-F2*CFriwFP!000001MOUEP?YBt{@CRb0SSnR!3(HpMRBv-jMlUjf*8w+Cz z!0xgL2n*~k2t`D|Cb2~71$3$wYO8nyYcw*USl1S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": "", "sysreqs_packages": {} }, + { + "ref": "DBI", + "package": "DBI", + "version": "1.2.2", + "type": "standard", + "direct": false, + "binary": true, + "dependencies": [], + "vignettes": false, + "needscompilation": false, + "metadata": { + "RemoteType": "standard", + "RemotePkgRef": "DBI", + "RemoteRef": "DBI", + "RemoteRepos": "https://packagemanager.posit.co/cran/__linux__/jammy/latest", + "RemotePkgPlatform": "x86_64-pc-linux-gnu-ubuntu-22.04", + "RemoteSha": "1.2.2" + }, + "sources": ["https://packagemanager.posit.co/cran/__linux__/jammy/latest/src/contrib/DBI_1.2.2.tar.gz"], + "target": "src/contrib/x86_64-pc-linux-gnu-ubuntu-22.04/4.3/DBI_1.2.2.tar.gz", + "platform": "x86_64-pc-linux-gnu-ubuntu-22.04", + "rversion": "4.3", + "directpkg": false, + "license": "LGPL (>= 2.1)", + "dep_types": ["Depends", "Imports", "LinkingTo"], + "params": [], + "install_args": "", + "repotype": "cranlike", + "sysreqs": "", + "sysreqs_packages": {} + }, + { + "ref": "R6", + "package": "R6", + "version": "2.5.1", + "type": "standard", + "direct": false, + "binary": true, + "dependencies": [], + "vignettes": false, + "needscompilation": false, + "metadata": { + "RemoteType": "standard", + "RemotePkgRef": "R6", + "RemoteRef": "R6", + "RemoteRepos": "https://packagemanager.posit.co/cran/__linux__/jammy/latest", + "RemotePkgPlatform": "x86_64-pc-linux-gnu-ubuntu-22.04", + "RemoteSha": "2.5.1" + }, + "sources": ["https://packagemanager.posit.co/cran/__linux__/jammy/latest/src/contrib/R6_2.5.1.tar.gz"], + "target": "src/contrib/x86_64-pc-linux-gnu-ubuntu-22.04/4.3/R6_2.5.1.tar.gz", + "platform": "x86_64-pc-linux-gnu-ubuntu-22.04", + "rversion": "4.3", + "directpkg": false, + "license": "MIT + file LICENSE", + "dep_types": ["Depends", "Imports", "LinkingTo"], + "params": [], + "install_args": "", + "repotype": "cranlike", + "sysreqs": "", + "sysreqs_packages": {} + }, + { + "ref": "RColorBrewer", + "package": "RColorBrewer", + "version": "1.1-3", + "type": "standard", + "direct": false, + "binary": true, + "dependencies": [], + "vignettes": false, + "needscompilation": false, + "metadata": { + "RemoteType": "standard", + "RemotePkgRef": "RColorBrewer", + "RemoteRef": "RColorBrewer", + "RemoteRepos": "https://packagemanager.posit.co/cran/__linux__/jammy/latest", + "RemotePkgPlatform": "x86_64-pc-linux-gnu-ubuntu-22.04", + "RemoteSha": "1.1-3" + }, + "sources": ["https://packagemanager.posit.co/cran/__linux__/jammy/latest/src/contrib/RColorBrewer_1.1-3.tar.gz"], + "target": "src/contrib/x86_64-pc-linux-gnu-ubuntu-22.04/4.3/RColorBrewer_1.1-3.tar.gz", + "platform": "x86_64-pc-linux-gnu-ubuntu-22.04", + "rversion": "4.3", + "directpkg": false, + "license": "Apache License 2.0", + "dep_types": ["Depends", "Imports", "LinkingTo"], + "params": [], + "install_args": "", + "repotype": "cranlike", + "sysreqs": "", + "sysreqs_packages": {} + }, + { + "ref": "RPostgres", + "package": "RPostgres", + "version": "1.4.6", + "type": "standard", + "direct": false, + "binary": true, + "dependencies": ["bit64", "blob", "DBI", "hms", "lubridate", "withr"], + "vignettes": false, + "needscompilation": false, + "metadata": { + "RemoteType": "standard", + "RemotePkgRef": "RPostgres", + "RemoteRef": "RPostgres", + "RemoteRepos": "https://packagemanager.posit.co/cran/__linux__/jammy/latest", + "RemotePkgPlatform": "x86_64-pc-linux-gnu-ubuntu-22.04", + "RemoteSha": "1.4.6" + }, + "sources": ["https://packagemanager.posit.co/cran/__linux__/jammy/latest/src/contrib/RPostgres_1.4.6.tar.gz"], + "target": "src/contrib/x86_64-pc-linux-gnu-ubuntu-22.04/4.3/RPostgres_1.4.6.tar.gz", + "platform": "x86_64-pc-linux-gnu-ubuntu-22.04", + "rversion": "4.3", + "directpkg": false, + "license": "MIT + file LICENSE", + "dep_types": ["Depends", "Imports", "LinkingTo"], + "params": [], + "install_args": "", + "repotype": "cranlike", + "sysreqs": "libpq >= 9.0: libpq-dev (deb) or postgresql-devel (rpm)", + "sysreqs_packages": [ + { + "sysreq": "postgresql", + "packages": ["libpq-dev"], + "pre_install": {}, + "post_install": {} + } + ] + }, + { + "ref": "RSQLite", + "package": "RSQLite", + "version": "2.3.5", + "type": "standard", + "direct": false, + "binary": true, + "dependencies": ["bit64", "blob", "DBI", "memoise", "pkgconfig", "rlang"], + "vignettes": false, + "needscompilation": false, + "metadata": { + "RemoteType": "standard", + "RemotePkgRef": "RSQLite", + "RemoteRef": "RSQLite", + "RemoteRepos": "https://packagemanager.posit.co/cran/__linux__/jammy/latest", + "RemotePkgPlatform": "x86_64-pc-linux-gnu-ubuntu-22.04", + "RemoteSha": "2.3.5" + }, + "sources": ["https://packagemanager.posit.co/cran/__linux__/jammy/latest/src/contrib/RSQLite_2.3.5.tar.gz"], + "target": "src/contrib/x86_64-pc-linux-gnu-ubuntu-22.04/4.3/RSQLite_2.3.5.tar.gz", + "platform": "x86_64-pc-linux-gnu-ubuntu-22.04", + "rversion": "4.3", + "directpkg": false, + "license": "LGPL (>= 2.1)", + "dep_types": ["Depends", "Imports", "LinkingTo"], + "params": [], + "install_args": "", + "repotype": "cranlike", + "sysreqs": "", + "sysreqs_packages": {} + }, + { + "ref": "Rcpp", + "package": "Rcpp", + "version": "1.0.12", + "type": "standard", + "direct": false, + "binary": true, + "dependencies": [], + "vignettes": false, + "needscompilation": false, + "metadata": { + "RemoteType": "standard", + "RemotePkgRef": "Rcpp", + "RemoteRef": "Rcpp", + "RemoteRepos": "https://packagemanager.posit.co/cran/__linux__/jammy/latest", + "RemotePkgPlatform": "x86_64-pc-linux-gnu-ubuntu-22.04", + "RemoteSha": "1.0.12" + }, + "sources": ["https://packagemanager.posit.co/cran/__linux__/jammy/latest/src/contrib/Rcpp_1.0.12.tar.gz"], + "target": "src/contrib/x86_64-pc-linux-gnu-ubuntu-22.04/4.3/Rcpp_1.0.12.tar.gz", + "platform": "x86_64-pc-linux-gnu-ubuntu-22.04", + "rversion": "4.3", + "directpkg": false, + "license": "GPL (>= 2)", + "dep_types": ["Depends", "Imports", "LinkingTo"], + "params": [], + "install_args": "", + "repotype": "cranlike", + "sysreqs": "", + "sysreqs_packages": {} + }, { "ref": "askpass", "package": "askpass", @@ -311,11 +504,11 @@ { "ref": "bslib", "package": "bslib", - "version": "0.7.0", + "version": "0.6.1", "type": "standard", "direct": false, "binary": true, - "dependencies": ["base64enc", "cachem", "fastmap", "htmltools", "jquerylib", "jsonlite", "lifecycle", "memoise", "mime", "rlang", "sass"], + "dependencies": ["base64enc", "cachem", "htmltools", "jquerylib", "jsonlite", "lifecycle", "memoise", "mime", "rlang", "sass"], "vignettes": false, "needscompilation": false, "metadata": { @@ -324,7 +517,7 @@ "RemoteRef": "bslib", "RemoteRepos": "https://packagemanager.posit.co/cran/__linux__/jammy/latest", "RemotePkgPlatform": "x86_64-pc-linux-gnu-ubuntu-22.04", - "RemoteSha": "0.7.0" + "RemoteSha": "0.6.1" }, "sources": ["https://packagemanager.posit.co/cran/__linux__/jammy/latest/src/contrib/bslib_0.7.0.tar.gz"], "target": "src/contrib/x86_64-pc-linux-gnu-ubuntu-22.04/4.4/bslib_0.7.0.tar.gz", @@ -373,7 +566,7 @@ { "ref": "callr", "package": "callr", - "version": "3.7.6", + "version": "3.7.5", "type": "standard", "direct": false, "binary": true, @@ -386,7 +579,7 @@ "RemoteRef": "callr", "RemoteRepos": "https://packagemanager.posit.co/cran/__linux__/jammy/latest", "RemotePkgPlatform": "x86_64-pc-linux-gnu-ubuntu-22.04", - "RemoteSha": "3.7.6" + "RemoteSha": "3.7.5" }, "sources": ["https://packagemanager.posit.co/cran/__linux__/jammy/latest/src/contrib/callr_3.7.6.tar.gz"], "target": "src/contrib/x86_64-pc-linux-gnu-ubuntu-22.04/4.4/callr_3.7.6.tar.gz", @@ -727,7 +920,7 @@ { "ref": "data.table", "package": "data.table", - "version": "1.15.4", + "version": "1.15.2", "type": "standard", "direct": false, "binary": true, @@ -740,7 +933,7 @@ "RemoteRef": "data.table", "RemoteRepos": "https://packagemanager.posit.co/cran/__linux__/jammy/latest", "RemotePkgPlatform": "x86_64-pc-linux-gnu-ubuntu-22.04", - "RemoteSha": "1.15.4" + "RemoteSha": "1.15.2" }, "sources": ["https://packagemanager.posit.co/cran/__linux__/jammy/latest/src/contrib/data.table_1.15.4.tar.gz"], "target": "src/contrib/x86_64-pc-linux-gnu-ubuntu-22.04/4.4/data.table_1.15.4.tar.gz", @@ -1619,7 +1812,7 @@ "type": "standard", "direct": false, "binary": true, - "dependencies": ["base64enc", "digest", "fastmap", "rlang"], + "dependencies": ["base64enc", "digest", "ellipsis", "fastmap", "rlang"], "vignettes": false, "needscompilation": false, "metadata": { @@ -1994,7 +2187,7 @@ { "ref": "lintr", "package": "lintr", - "version": "3.1.2", + "version": "3.1.1", "type": "standard", "direct": false, "binary": true, @@ -2007,7 +2200,7 @@ "RemoteRef": "lintr", "RemoteRepos": "https://packagemanager.posit.co/cran/__linux__/jammy/latest", "RemotePkgPlatform": "x86_64-pc-linux-gnu-ubuntu-22.04", - "RemoteSha": "3.1.2" + "RemoteSha": "3.1.1" }, "sources": ["https://packagemanager.posit.co/cran/__linux__/jammy/latest/src/contrib/lintr_3.1.2.tar.gz"], "target": "src/contrib/x86_64-pc-linux-gnu-ubuntu-22.04/4.4/lintr_3.1.2.tar.gz", @@ -2180,7 +2373,7 @@ { "ref": "munsell", "package": "munsell", - "version": "0.5.1", + "version": "0.5.0", "type": "standard", "direct": false, "binary": true, @@ -2193,7 +2386,7 @@ "RemoteRef": "munsell", "RemoteRepos": "https://packagemanager.posit.co/cran/__linux__/jammy/latest", "RemotePkgPlatform": "x86_64-pc-linux-gnu-ubuntu-22.04", - "RemoteSha": "0.5.1" + "RemoteSha": "0.5.0" }, "sources": ["https://packagemanager.posit.co/cran/__linux__/jammy/latest/src/contrib/munsell_0.5.1.tar.gz"], "target": "src/contrib/x86_64-pc-linux-gnu-ubuntu-22.04/4.4/munsell_0.5.1.tar.gz", @@ -3221,7 +3414,7 @@ { "ref": "rstudioapi", "package": "rstudioapi", - "version": "0.16.0", + "version": "0.15.0", "type": "standard", "direct": false, "binary": true, @@ -3234,7 +3427,7 @@ "RemoteRef": "rstudioapi", "RemoteRepos": "https://packagemanager.posit.co/cran/__linux__/jammy/latest", "RemotePkgPlatform": "x86_64-pc-linux-gnu-ubuntu-22.04", - "RemoteSha": "0.16.0" + "RemoteSha": "0.15.0" }, "sources": ["https://packagemanager.posit.co/cran/__linux__/jammy/latest/src/contrib/rstudioapi_0.16.0.tar.gz"], "target": "src/contrib/x86_64-pc-linux-gnu-ubuntu-22.04/4.4/rstudioapi_0.16.0.tar.gz", diff --git a/vignettes/benchmarks.Rmd b/vignettes/benchmarks.Rmd deleted file mode 100644 index 816c1abc..00000000 --- a/vignettes/benchmarks.Rmd +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: "SCDB: Benchmarks" -output: rmarkdown::html_vignette -bibliography: "references.bib" -vignette: > - %\VignetteIndexEntry{SCDB: Benchmarks} - %\VignetteEngine{knitr::rmarkdown} - %\VignetteEncoding{UTF-8} ---- - -```{r, include = FALSE} -knitr::opts_chunk$set( - collapse = TRUE, - comment = "#>" -) -``` - -To showcase the performance of `SCDB` on different database backends, we include this vignette that summarises a simple -benchmark: -A sample dataset is created based on the `datasets::iris` dataset. This data is repeated 10 times and given a unique ID -(the row number of the data). - -This data forms the basis for three "snapshots" used in the benchmarks: - -1) The data as described above. - -2) As 1. but where any `Sepal.Length` below the median is halved. - -3) As 2. but where any `Sepal.width` below the median is halved. - -The benchmark function uses three consecutive calls to `update_snapshot()` to create the table with first snapshot and -then update it to the second and third snapshot. Finally, the table is deleted. - -The performance of this benchmark function is timed with the `microbenchmark` package using 10 replicates. -All benchmarks are run on the same machine. - -The results of the benchmark are shown graphically below (mean and standard deviation), where we compare the current -development version of `SCDB` with the current CRAN version. - -```{r, echo = FALSE, eval = requireNamespace("here")} -benchmark_location <- c( - system.file("extdata", "benchmarks.rds", package = "SCDB"), - here::here("inst", "extdata", "benchmarks.rds") -) |> - purrr::discard(~ identical(., "")) |> - purrr::pluck(1) - -benchmarks <- readRDS(benchmark_location) - -# Determine if the SHA is on main -sha <- benchmarks |> - dplyr::distinct(version) |> - dplyr::filter(!(version %in% c("CRAN", "main"))) |> - dplyr::pull("version") - -# Check local git history -on_main <- tryCatch({ - system(glue::glue("git branch main --contains {sha}"), intern = TRUE) |> - stringr::str_detect(stringr::fixed("main")) |> - isTRUE() -}, warning = function(w) { - # If on GitHub, git is not installed and we assume TRUE. - # This will render the vignette as it will look once merged onto main. - return(identical(Sys.getenv("CI"), "true")) -}) - -# If the SHA has been merged, use as the "main" version and remove the other, older, main version -if (on_main) { - benchmarks <- benchmarks |> - dplyr::filter(version != "main") |> - dplyr::mutate(version = dplyr::if_else(.data$version == "CRAN", "CRAN", "development")) -} - -# Add note slow backends -slow_backends <- benchmarks |> - dplyr::distinct(.data$database, .data$n) |> - dplyr::filter(.data$n < max(.data$n)) |> - dplyr::pull("database") - -benchmarks <- benchmarks |> - dplyr::mutate("database" = paste0(database, ifelse(database %in% slow_backends, "*", ""))) - - -# Mean and standard deviation (see ggplot2::mean_se()) -mean_sd <- function(x) { - mu <- mean(x) - sd <- sd(x) - data.frame(y = mu, ymin = mu - sd, ymax = mu + sd) -} - -g <- ggplot2::ggplot( - benchmarks, - ggplot2::aes(x = version, y = time / 1e9) -) + - ggplot2::stat_summary(fun.data = mean_sd, geom = "pointrange", size = 0.5, linewidth = 1) + - ggplot2::facet_grid(rows = ggplot2::vars(benchmark_function), cols = ggplot2::vars(database)) + - ggplot2::labs(x = "Codebase version", y = "Time (s)") - -if (length(slow_backends) > 1) { - g <- g + ggplot2::labs(caption = "* IMPORTANT: Benchmark data halved for this backend!") -} - -g -```