Skip to content

Conversation

@symwell
Copy link
Contributor

@symwell symwell commented Sep 9, 2022

Use our optimized version of extract_last_comment that runs 65x faster until the corresponding pr in method_source gets merged.

Fixes #276

@symwell symwell force-pushed the sw/part_custom_method_source branch 2 times, most recently from 8482da5 to e8531f0 Compare September 12, 2022 13:52
@symwell symwell changed the title Use AppMap's optimized extract_last_comment perf: Use AppMap's optimized extract_last_comment Sep 15, 2022
….rb until MethodSource merges the pr that applies the optimization.
@symwell symwell force-pushed the sw/part_custom_method_source branch from e8531f0 to 6e843d0 Compare September 15, 2022 12:17
Copy link
Contributor

@dividedmind dividedmind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@symwell
Copy link
Contributor Author

symwell commented Sep 16, 2022

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 discourse:

 APPMAP=true bundle exec rspec spec/serializers --order defined

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.

@dividedmind
Copy link
Contributor

Superseded by #283

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.

Take the method_source code we need and copy it in AppMap, to not depend on method_source or conflict with it in the wild

3 participants