Skip to content

Commit

Permalink
updatedf with new version
Browse files Browse the repository at this point in the history
  • Loading branch information
schochastics committed Jan 25, 2025
1 parent 3eb65f7 commit 39e5855
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
19 changes: 10 additions & 9 deletions data-raw/benchmark.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Benchmarking adaR


``` r
library(adaR)
library(urltools)
Expand Down Expand Up @@ -343,8 +344,8 @@ bench::mark(
# A tibble: 2 × 6
expression min median `itr/sec` mem_alloc `gc/sec`
<bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl>
1 urltools 338µs 384µs 2411. 2.49KB 12.1
2 ada 516µs 580µs 1612. 2.49KB 9.73
1 urltools 105.9µs 111.07µs 8054. 0B 40.5
2 ada 2.21µs 2.42µs 408755. 0B 0

``` r
bench::mark(
Expand All @@ -359,8 +360,8 @@ bench::mark(
# A tibble: 2 × 6
expression min median `itr/sec` mem_alloc `gc/sec`
<bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl>
1 urltools 230ms 230ms 4.34 6.08MB 4.34
2 ada 245ms 245ms 4.09 9.18MB 0
1 urltools 99.4ms 99.4ms 10.1 4.96MB 10.1
2 ada 103.2ms 103.2ms 9.69 8.64MB 0

In terms of runtime, both are almost indiscernible. The advantage of
adaR is its added accuracy.
Expand All @@ -375,16 +376,16 @@ extract public suffix.
bench::mark(
urltools = suffix_extract("https://user_1:[email protected]:8080/dir/../api?q=1#frag"),
ada = public_suffix("https://user_1:[email protected]:8080/dir/../api?q=1#frag"),
psl = psl::public_suffix("https://user_1:[email protected]:8080/dir/../api?q=1#frag"),iterations = 1000, check = FALSE
#psl = psl::public_suffix("https://user_1:[email protected]:8080/dir/../api?q=1#frag"),
check = FALSE
)
```

# A tibble: 3 × 6
# A tibble: 2 × 6
expression min median `itr/sec` mem_alloc `gc/sec`
<bch:expr> <bch:tm> <bch:tm> <dbl> <bch:byt> <dbl>
1 urltools 368.29µs 448.09µs 2047. 103KB 10.3
2 ada 18.87µs 20.47µs 45943. 35.9KB 0
3 psl 3.85µs 5.62µs 163250. 17.6KB 163.
1 urltools 102.83µs 110µs 9028. 95.6KB 28.4
2 ada 4.84µs 5.33µs 181773. 30.9KB 36.4

(*This comparison is not fair for `urltools` since the function
`suffix_extract` does more than just extracting the public suffix.*)
Expand Down
3 changes: 2 additions & 1 deletion data-raw/benchmark.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ Here we compare `adaR` with `urltools` and additionally with [`psl`](https://git
bench::mark(
urltools = suffix_extract("https://user_1:[email protected]:8080/dir/../api?q=1#frag"),
ada = public_suffix("https://user_1:[email protected]:8080/dir/../api?q=1#frag"),
psl = psl::public_suffix("https://user_1:[email protected]:8080/dir/../api?q=1#frag"),iterations = 1000, check = FALSE
#psl = psl::public_suffix("https://user_1:[email protected]:8080/dir/../api?q=1#frag"),
check = FALSE
)
```

Expand Down

0 comments on commit 39e5855

Please sign in to comment.