perf: Use AppMap's optimized extract_last_comment#279
Closed
Conversation
8482da5 to
e8531f0
Compare
extract_last_commentextract_last_comment
….rb until MethodSource merges the pr that applies the optimization.
e8531f0 to
6e843d0
Compare
dividedmind
requested changes
Sep 16, 2022
Contributor
dividedmind
left a comment
There was a problem hiding this comment.
All this code should go in a separate module.
BTW, is it really any faster? https://github.com/applandinc/appmap-ruby/pull/279/files#diff-c7d68f4ec3680a58ebfd3aa08e9e7e1aa17b885e25ea3587e12f99a160b3c09cR69 reads the whole file and materializes the full line array anyway.
Contributor
Author
|
The speedup isn't from not reading (caching) the file but from iterating through the line array backwards. It's faster, confirmed by running on
|
Contributor
|
Superseded by #283 |
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.
Use our optimized version of
extract_last_commentthat runs 65x faster until the corresponding pr inmethod_sourcegets merged.Fixes #276