ropensci / oai

OAI-PMH R client
https://docs.ropensci.org/oai
Other
14 stars 4 forks source link

Speed up some tests #19

Closed sckott closed 9 years ago

sckott commented 9 years ago

Looked at times of tests, seems there's two we need to speed up. I'll work on list_identifiers. @mbojan - can you make the dumpers tests faster?

                           .id user.self sys.self elapsed user.child sys.child
10            test-providers.R     0.028    0.001   0.042      0.000     0.000
8          test-list_records.R     0.088    0.002   0.606      0.000     0.000
3           test-get_records.R     0.092    0.003   0.787      0.000     0.000
7  test-list_metadataformats.R     0.100    0.004   0.992      0.000     0.000
5                    test-id.R     0.090    0.004   2.443      0.000     0.000
4         test-handle_errors.R     0.079    0.010   3.266      0.000     0.000
1     test-count_identifiers.R     0.265    0.020   6.917      7.717     0.097
9             test-list_sets.R     1.012    0.018   7.045      0.000     0.000
6      test-list_identifiers.R    19.338    0.181 111.121      0.000     0.000
2               test-dumpers.R    19.518    0.680 259.208      0.000     0.000
mbojan commented 9 years ago

OK, I'll have a look. I think fetching data takes most of the time. Perhaps it is enough to come up with a service plus from until combinations that return a reasonable-sized results.

sckott commented 9 years ago

thanks

mbojan commented 9 years ago

How did you time the tests? Is there some convenient way?

sckott commented 9 years ago

I use this https://github.com/sckott/sacbox/blob/master/R/timetests.r for any set of test files. Runs tests, times elapsed time for all tests, makes data.frame, sorts it

mbojan commented 9 years ago

great! thx

mbojan commented 9 years ago

I think count_identifiers could use some reducing diet too. See also #25 .

sckott commented 9 years ago

Now test times are at:

                           .id user.self sys.self elapsed user.child sys.child
10            test-providers.R     0.024    0.002   0.044      0.000     0.000
8          test-list_records.R     0.086    0.004   0.623      0.000     0.000
3           test-get_records.R     0.091    0.003   0.830      0.000     0.000
7  test-list_metadataformats.R     0.100    0.004   0.962      0.000     0.000
5                    test-id.R     0.095    0.006   2.573      0.000     0.000
1     test-count_identifiers.R     0.272    0.027   3.901      0.000     0.000
2               test-dumpers.R     0.636    0.030   4.715      8.632     0.129
4         test-handle_errors.R     0.174    0.013   6.706      0.000     0.000
6      test-list_identifiers.R     1.320    0.036   6.744      0.000     0.000
9             test-list_sets.R     1.697    0.036   7.978      0.000     0.000
sckott commented 9 years ago

I think we can probably close now

mbojan commented 9 years ago

I think so too.