Page MenuHomePhabricator

Fix explosive runtime of detectCopiedCode()
ClosedPublic

Authored by epriestley on May 18 2014, 4:37 AM.
Tags
None
Referenced Files
F14064139: D9178.diff
Mon, Nov 18, 9:59 PM
F14046141: D9178.diff
Wed, Nov 13, 6:29 PM
F14033609: D9178.diff
Sat, Nov 9, 6:36 PM
F14005732: D9178.id21797.diff
Sun, Oct 27, 6:34 PM
F13970669: D9178.id21854.diff
Oct 17 2024, 9:11 AM
F13958898: D9178.id.diff
Oct 14 2024, 4:55 PM
Unknown Object (File)
Oct 9 2024, 4:05 PM
Unknown Object (File)
Oct 7 2024, 10:42 AM
Subscribers
Tokens
"Mountain of Wealth" token, awarded by chad.

Details

Summary

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.

Test Plan

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

Repository
rP Phabricator
Branch
detectxplode
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 545
Build 545: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

epriestley retitled this revision from to Fix explosive runtime of detectCopiedCode().
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
btrahan edited edge metadata.

Hazzah!

This revision is now accepted and ready to land.May 19 2014, 6:22 PM
epriestley updated this revision to Diff 21854.

Closed by commit rPb64407d47e18 (authored by @epriestley).