Closed Bug 1523948 Opened 5 years ago Closed 5 years ago

avoid bounds checks in nsTArray binary search methods

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: froydnj, Assigned: froydnj)

Details

Attachments

(1 file)

We already take steps in IndexOf to avoid bounds checks--by using
direct pointer accesses--and we should do the same thing for binary
searches as well.

I verified this does what it's supposed to by examining the assembly for some
DeadlockDetector methods.  Should be a nice micro-optimization for debug builds.
Attachment #9040115 - Flags: review?(erahm)
Attachment #9040115 - Flags: review?(erahm) → review+
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e2e7beefa147
avoid bounds checks in nsTArray binary search methods; r=erahm
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: