Fixes T5041. Pretty sure this is the issue: if a diff contains a large number of identical lines longer than 30 characters, we end up paying O(N^2) for each set.
Instead, when N > 16, opt to pay 0.
Differential D9178
Fix explosive runtime of detectCopiedCode() epriestley on May 18 2014, 4:37 AM. Authored by Tags None Referenced Files
Subscribers Tokens
Details
Fixes T5041. Pretty sure this is the issue: if a diff contains a large number of identical lines longer than 30 characters, we end up paying O(N^2) for each set. Instead, when N > 16, opt to pay 0. Added a test which dropped from ~100s to ~0 after changes (this diff includes a reduced-strenght version of the test, since parsing a 4,000 line diff is a little bit pricey).
Diff Detail
Event Timeline |