Closed symwell closed 2 years ago
Closed. Superceded by https://github.com/banister/method_source/pull/78
In extract_last_comment don't go over all lines of the file if the last comment is in the last 100 lines.
extract_last_comment
When used with a benchmark that called extract_last_comment 56411 times:
20.15s
5.89s
0.31s
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.
Closed. Superceded by https://github.com/banister/method_source/pull/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 from20.15s
to5.89s
)20.15s
to0.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.