blackducksoftware / hub-rest-api-python

HUB REST API Python bindings
Apache License 2.0
89 stars 104 forks source link

Increase default page_size #175

Closed OffBy0x01 closed 3 years ago

OffBy0x01 commented 3 years ago

Page size of 100 was far too conservative. 250 will dramatically improve exec times for most users, whilst remaining manageable for resources with many results.

Average (of 10) time taken to get 1000 items, with varying page sizes: page_size | Local to Blackduck 100 | 18.878 150 | 16.700 200 | 15.696 250 | 13.675 500 | 13.702 1000 | 13.736

skiyooka commented 3 years ago

Hmm, do you have any timings on how long typical queries take with 1000 elements? I choose 100 for projects, versions, codelocations, etc. as it took approximately 2-3 seconds (this was for HubInstance) to return when hitting a moderately loaded hosted server. I think that a page size where common queries return in under 5 (up to 10?) seconds tops is a potential goal. Anyway on my side I'll give Sage a whirl with the 1000 default and see how some of our servers respond.

skiyooka commented 3 years ago

I did some testing on my end (Sage works fine either way). Completely open to upping the limit to whatever makes sense.

skiyooka commented 3 years ago

I've updated this and merged it in as I would like to publish a new version of hub-rest-api-python to include this and the bearer token renewal fix.