-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Improve the paths subsets of jobs #220
Conversation
230012b
to
a9ba64b
Compare
Visit the preview URL for this PR (updated for commit 8c2c327): https://gcode-preview--pr220-introduce-indexers-34ft8rl4.web.app (expires Fri, 15 Nov 2024 00:54:46 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 59bd114ae4847b32c2bba0b68620b9069a3e3531 |
638adb2
to
76a4c17
Compare
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @sophiedeziel and the rest of your teammates on |
3071658
to
cdaebe1
Compare
678a96f
to
256595a
Compare
e32e879
to
d81f5ea
Compare
d81f5ea
to
8c2c327
Compare
* Introduce the traveltype indexer * Add the layer indexer * don't clear for all types * Fix the calls to the getters * Cleaner error management * Fix all tests
* Introduce the traveltype indexer * Add the layer indexer * don't clear for all types * Fix the calls to the getters * Cleaner error management * Fix all tests
Follow up to #211
layers
,extrusions
andtravels
are now more performant!Instead of filtering the whole
paths
array each time, the job uses indexers to categorize paths as they are added. They are then accessed as readily available data without additional logic.To implement indexes, logic to have paths "in progress" and finish them had to be implemented to only index when the path is finished.
Paths are indexed as they are added to a job, which is less expensive than filtering the array on the spot. Jobs have a set of default indexers. They can be added or removed for the different rendering modes. It paves the way to #121 as we'll have to index for the different types of extrusions. It is also a possible implementation for #183.
When an indexer throws an error, it is interpreted as not applicable for a specific job. It is removed from the list of indexers for the rest of the commands. I am pretty happy about that design; it stops some code and conditions from running for the rest of the list of paths we are iterating on.
Adding/removing indexers will have a significant impact later when we have many of them. Other logic related to stats and calculations may follow a similar design and benefit from being composed. If they become expensive, we'll only use what is needed.
Next PR would be to bring back the tolerance logic inside the indexer that was omitted in #211
Note that this branch was not rebased after #215, making progressive rendering a bit funky. With the fix, you'll notice the smoothness is back.