edgecase / bird-wave

An api for eBird data
0 stars 0 forks source link

Load all year's records up-front #6

Closed tennety closed 10 years ago

tennety commented 10 years ago

@DerekBriggs suggested that we could load all year's sightings up front when the bird is selected, so that it's in memory when the user picks the months.

I think our current schema allows for this, since we can return all the records grouped by the month-yr, so that finding the data for the month is just looking it up by month-yr in the returned JSON object. I can take a crack at it.

PixelJanitor commented 10 years ago

This would make the user interaction much quicker when selecting the months for that bird. One large load on the initial choice rather than a bunch of intermediate loads while the user is actually interacting with the data.

Derek

On Feb 17, 2014, at 8:47 PM, Chandu Tennety notifications@github.com wrote:

@DerekBriggs suggested that we could load all year's sightings up front when the bird is selected, so that it's in memory when the user picks the months.

I think our current schema allows for this, since we can return all the records grouped by the month-yr, so that finding the data for the month is just looking it up by month-yr in the returned JSON object. I can take a crack at it.

— Reply to this email directly or view it on GitHub.

jxa commented 10 years ago

The way the data is currently queried it would be unacceptably slow to load all records up front. #7 improves query performance quite a bit, about 3 seconds for a full year of bald eagles. In addition to loading the full year. There are 2 things that I can think of to give a faster initial load as well as improved responsiveness.

  1. cache the query results as they are generated. This means responsiveness will improve over time as people use the app.
  2. start fetching the next month's data as soon as the first set is received.
  3. other ideas?
tennety commented 10 years ago

PR #9 fixes this concern, and the app is much quicker to react. Closing.