Repository navigation
Avoid quadratic behavior when cleaning assembly labels - #1284
Merged
Merged
Conversation
If you had a tree of labels like this: ``` mov .L0 mov .L1 mov .L2 .L0: .quad .L1 .L1: .quad .L2 .L2: .quad 1 ``` The graph processing would take quadratic time because it started at each label referenced by the initial instructions and walk the entire graph over and over, repeating nodes. We now avoid re-visiting the same node. | # of labels | original time (ms) | improved time (ms) | |------------:|-------------------:|-------------------:| | 1000 | 37.7 | 4.2 | | 2000 | 132.9 | 4.9 | | 4000 | 538.1 | 5.7 | | 8000 | 2394.2 | 13.1 | I don't know how feasible it is to write realistic Rust code that generates this assembly. I think you'd have to have a bunch of `static`s that reference each other and then use all of them. Regardless, this is a small change to address the possibility.
This file contains hidden or 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
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.
No description provided.