Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpp implementation of URLdecode #25

Merged
merged 3 commits into from
Sep 24, 2023
Merged

cpp implementation of URLdecode #25

merged 3 commits into from
Sep 24, 2023

Conversation

schochastics
Copy link
Member

ref #13

urls <- rep("https://www.google.co.jp/search?q=\u30c9\u30a4\u30c4",10000)
bench::mark(
    cpp = url_decode(urls),
    URLdecode = URLdecode(urls),
    iterations = 1, check=FALSE
)
# A tibble: 2 × 13
  expression      min   median `itr/sec` mem_alloc `gc/sec` n_itr  n_gc total_time result
  <bch:expr> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl> <int> <dbl>   <bch:tm> <list>
1 cpp          10.3ms   10.3ms     96.9     80.7KB      0       1     0     10.3ms <NULL>
2 URLdecode   390.6ms  390.6ms      2.56    78.2KB     12.8     1     5    390.6ms <NULL>
# ℹ 3 more variables: memory <list>, time <list>, gc <list>

output += input[i];
i++;
} else {
int value;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would better to change this to unsigned int

@chainsawriot
Copy link
Collaborator

The little benchmark in #22 is now 82ms; solid improvement from >1000ms.

@schochastics schochastics marked this pull request as ready for review September 24, 2023 19:05
@schochastics schochastics merged commit a03a202 into main Sep 24, 2023
6 checks passed
@schochastics schochastics mentioned this pull request Sep 24, 2023
@schochastics schochastics deleted the URLdecode-speedup branch September 25, 2023 10:27
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.

2 participants