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

Parallelise the history JSON loads for faster initial load times. #14

Merged
merged 2 commits into from
Jul 31, 2017
Merged

Parallelise the history JSON loads for faster initial load times. #14

merged 2 commits into from
Jul 31, 2017

Conversation

daviessm
Copy link

Currently the history load code waits for each file to be returned before requesting the next. This modification requests all files at the same time and keeps count of how many are returned. Once they're all back, end_load_history is called as normal. Any files which fail to load are ignored, rather than stopping the load at the point.

Also correct the "applying history" error message to match the counter against the total - previously it finished with "119/120" because the files are numbered from 0.

As a by-product, for my test server using http/2 this halved the load time against the same code using http/1.1 due to the protocol's improvements in parallel resource loads.

As a by-product, for my test server using http/2 this halved the load time against the same code using http/1.1.
@0ip
Copy link

0ip commented Jul 29, 2017

Interesting coincidence:
mutability#206 😉

@daviessm
Copy link
Author

Hah, @mutability can choose his preferred implementation (or neither)!

@mutability mutability changed the base branch from master to dev July 31, 2017 11:09
@mutability mutability merged commit 51e3e1d into flightaware:dev Jul 31, 2017
@mutability
Copy link

This is a nice speedup, thanks!

@daviessm
Copy link
Author

@mutability it looks like we could do something similar for dbloader.js. Was there a reason for the AJAX queueing system there? If not I'll update that and submit another PR.

@mutability
Copy link

I think that was mostly because the db queries are not time critical and flooding out a bunch of requests isn't so great for interactivity since they will preempt the regular data refresh requests

@daviessm
Copy link
Author

I can see what you mean and have been trying to think of an elegant way to load them in parallel whilst keeping the refresh events top priority. If I come up with something I'll submit a new PR.

@smartynov
Copy link

@mutability will (are?) this changes be incorporated to https://github.com/mutability/dump1090? Should I close mutability#206 PR?

kpetrilli pushed a commit to kpetrilli/dump1090 that referenced this pull request Sep 15, 2020
…_load

Parallelise the history JSON loads for faster initial load times.
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

Successfully merging this pull request may close these issues.

None yet

4 participants