Closed Bug 1356282 Opened 7 years ago Closed 7 years ago

Sync's Utils.arrayUnion and Utils.arraySub should not be O(n^2)

Categories

(Firefox :: Sync, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
Firefox 55
Tracking Status
firefox55 --- fixed

People

(Reporter: tcsc, Assigned: tiago, Mentored)

Details

(Whiteboard: [good first bug])

Attachments

(1 file)

Currently these are needlessly O(n^2) (indexOf in a loop). They could be O(n) if implemented using Set.

I don't know of any cases where this causes a real performance problem, but I noticed it recently and made a mental note to file a bug for it.
P3, and also NI myself to investigate as a first bug.
Mentor: tchiovoloni
Flags: needinfo?(gkruglov)
Priority: -- → P3
Flags: needinfo?(gkruglov)
Whiteboard: [good first bug]
Comment on attachment 8864747 [details]
Bug 1356282 - Change Sync's Utils.arraySub to be O(n) using Set.

https://reviewboard.mozilla.org/r/136406/#review139718

Looks good and the test pass.
Attachment #8864747 - Flags: review?(tchiovoloni) → review+
Pushed by tchiovoloni@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/afee0d3c7aab
Change Sync's Utils.arraySub to be O(n) using Set. r=tcsc
https://hg.mozilla.org/mozilla-central/rev/afee0d3c7aab
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
Assignee: nobody → tiago.paez11
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: