Closed Bug 839325 Opened 11 years ago Closed 11 years ago

Cleanup in aisle GeckoViewsFactory

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 21

People

(Reporter: kats, Assigned: kats)

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
The table of things is really ugly, and the string compares probably aren't cheap when we're doing an average of 17.5 of them for every view.

Try run at https://tbpl.mozilla.org/?tree=Try&rev=13289444c45d for talos
Attachment #711611 - Flags: review?(sriram)
Comment on attachment 711611 [details] [diff] [review]
Patch

Review of attachment 711611 [details] [diff] [review]:
-----------------------------------------------------------------

This looks good to me.
How 17.5?
Why size /load-factor ?
Attachment #711611 - Flags: review?(sriram) → review+
(In reply to Sriram Ramasubramanian [:sriram] from comment #1)
> How 17.5?

Sorry, that should be 18. It'll do between 1 and 35 string compares. Since they're not ordered by frequency, assuming each one is hit once, that averages out to 18 string compares per call.

> Why size /load-factor ?

Because if the number of elements put into the hashtable is more than (capacity * load-factor) then the hashtable does an expensive resize operation to make itself bigger. If we know how many elements are going into it ahead of time, it's best to just size the hashtable correctly the first time.

https://hg.mozilla.org/integration/mozilla-inbound/rev/ffd1feb1a4c0
https://hg.mozilla.org/mozilla-central/rev/ffd1feb1a4c0
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 21
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: