Skip to content
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

Make extract_last_comment 65x faster #77

Closed
wants to merge 7 commits into from

Conversation

symwell
Copy link

@symwell symwell commented Aug 31, 2022

Closed. Superceded by #78

In extract_last_comment don't go over all lines of the file if the last comment is in the last 100 lines.

When used with a benchmark that called extract_last_comment 56411 times:

  • this improved performance by 3.42x (reduced execution time from 20.15s to 5.89s)
  • this improved performance by 65.4x (reduced execution time from 20.15s to 0.31s) when parsing comments backwards.
  • when the median number of lines in the opened files was 264 lines.

I tried to tune this with a different threshold, like 50-80 lines or 150-500 lines, and ~100 lines worked well for the benchmark used.

@symwell symwell changed the title Make extract_last_comment 3x faster Make extract_last_comment 65x faster Sep 1, 2022
@symwell symwell closed this Sep 1, 2022
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.

1 participant