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

Different executing time of get_inat_obs_user #42

Open
TlaskalV opened this issue Nov 1, 2019 · 1 comment
Open

Different executing time of get_inat_obs_user #42

TlaskalV opened this issue Nov 1, 2019 · 1 comment

Comments

@TlaskalV
Copy link

TlaskalV commented Nov 1, 2019

Hello,
I found out that time needed to download per user observations differs largely between users. Do you know the reason? Is it due to different geographic storage of the data or is it restricted by API request number (e.g. issue here)?
Is there any workaround to access single user observations faster?

Below are few tests, why it takes so long for friel with only 300?

Time to download 300 observations of the user friel
> system.time({ table <- rinat::get_inat_obs_user(username = "friel", maxresults = 300) })
user system elapsed
3.92 0.07 94.66

300 observations for zdekanovkov
> system.time({ table <- rinat::get_inat_obs_user(username = "zdekanovkov", maxresults = 300) })
user system elapsed
0.7 0.0 14.8

1500 observations for zdekanovkov - still shorter than for friel
> system.time({ table <- rinat::get_inat_obs_user(username = "zdekanovkov", maxresults = 1500) })
user system elapsed
0.71 0.00 15.67

respectable 50 000 observations for finatic (no. 3 user in total, note the time which is comparable to the first result)
> system.time({ table <- rinat::get_inat_obs_user(username = "finatic", maxresults = 300) })
user system elapsed
4.17 0.08 109.93

@stragu
Copy link
Collaborator

stragu commented Jun 14, 2022

Hi @TlaskalV

Thanks for the report.

Looks like the time needed is proportional to how many total observations the user has. The maxresults argument only limits how many observations will be returned by the function, but the version of the API we are using still looks for the totality of the user's observations when queried.

I think this might be fixed when we move to the more recent API, we'll have to see.

I'll keep this open, at least until we move to the newer API.

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

No branches or pull requests

2 participants