-
Notifications
You must be signed in to change notification settings - Fork 35
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
perf: router workers and optimizations #385
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
DanielSchiavini
commented
Aug 21, 2024
•
edited
Loading
edited
- Fixes Curvejs Performance: (Router swap) #312
- Runs the router graph creation and route finding algorithms in web workers, for UI responsivity
- This should be backwards compatible for any clients. It runs synchronously in nodejs.
- Route graph algorithm is not changed, just moved (a few changes were done to avoid list spread syntax, tsc uses helpers for that that do not work in a web worker)
- Route finding algorithm is optimized to preemptively stop routes when they are not possibly the best choices based on minTvl and route length.
- Route finding is roughly 3x faster (worst case, no match) up to 300x faster (best case, direct match) - check yourself if you wish with commit 892ec4e
DanielSchiavini
changed the title
Move route finding to a worker thread
Router workers and performance improvements
Aug 24, 2024
DanielSchiavini
commented
Aug 24, 2024
@@ -4,9 +4,11 @@ | |||
|
|||
/* Basic Options */ | |||
// "incremental": true, /* Enable incremental compilation */ | |||
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the worker code output a bit better - I think es6 is already well supported anyway
Screencast.from.26-08-24.09.33.15.webm |
Signed-off-by: Daniel Schiavini <daniel.schiavini@gmail.com>
Signed-off-by: Daniel Schiavini <daniel.schiavini@gmail.com>
DanielSchiavini
commented
Aug 27, 2024
DanielSchiavini
commented
Aug 27, 2024
DanielSchiavini
changed the title
Router workers and performance improvements
perf: router workers and optimizations
Aug 28, 2024
Macket
approved these changes
Aug 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.