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

speed up requests #133

Open
maxheld83 opened this issue Feb 17, 2021 · 4 comments
Open

speed up requests #133

maxheld83 opened this issue Feb 17, 2021 · 4 comments

Comments

@maxheld83
Copy link
Contributor

the requests are too damn slow, at least an order of magnitude slower than necessary as per the API I think.

Gotta do some profiling to figure out what's going on here.

@maxheld83
Copy link
Contributor Author

@njahn82 with caching now implemented, we're back to manageable runtimes:

bench::mark(metacheck = metacheck::render_email(sample(metacheck:::dois_many(), 10)))
#> Warning: Some expressions had a GC in every iteration; so filtering is disabled.
#> # A tibble: 1 x 6
#>   expression      min   median `itr/sec` mem_alloc `gc/sec`
#>   <bch:expr> <bch:tm> <bch:tm>     <dbl> <bch:byt>    <dbl>
#> 1 metacheck     23.8s    23.8s    0.0419    68.3MB    0.545

Created on 2021-03-08 by the reprex package (v1.0.0)

This scales up to 40mins for 1000 DOIs.

This is still not great.

Next steps would be:

@njahn82
Copy link
Collaborator

njahn82 commented Mar 8, 2021

Thanks. Do you have an example, how biblids::is_doi_found and biblids::is_doi_resolvable differ. They seem somehow redundant to me as DOIs must resolve to an URL. Maybe one function / api call testing if a DOI resolves is enough.

@maxheld83
Copy link
Contributor Author

Thanks. Do you have an example, how biblids::is_doi_found and biblids::is_doi_resolvable differ. They seem somehow redundant to me as DOIs must resolve to an URL. Maybe one function / api call testing if a DOI resolves is enough.

Moving discussion to #190.

@maxheld83
Copy link
Contributor Author

doi.org calls are now also cached on disc, should speed up by ~20%.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants