Opened on 05/24/2015 at 04:53:23 PM
Closed on 06/03/2015 at 03:45:33 PM
Last modified on 06/08/2015 at 10:54:00 AM
#2582 closed change (fixed)
ElemHide.getSelectorsForDomain() cannot be optimized by V8
Reported by: | sebastian | Assignee: | sebastian |
---|---|---|---|
Priority: | P4 | Milestone: | Adblock-Plus-2.6.10-for-Firefox |
Module: | Core | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Platform: | Unknown | |
Ready: | yes | Confidential: | no |
Tester: | Verified working: | no | |
Review URL(s): |
Description (last modified by sebastian)
Background
ElemHide.getSelectorsForDomain() is using a for..in to iterate over the keys of an object in hash-table mode. This prevents V8 from optimizing that function.
Currently, 30-60ms are spend in this function on every call, on my notebook with Chrome 43. However, when using Object.getOwnPropertyNames() only ~20ms are spent.
What to change
Iterate over the result of Object.getOwnPropertyNames() instead using a for..of loop in ElemHide.getSelectorsForDomain().
Attachments (0)
Change History (5)
comment:1 Changed on 05/24/2015 at 05:10:48 PM by sebastian
- Description modified (diff)
- Priority changed from P3 to P4
comment:2 Changed on 05/24/2015 at 05:12:17 PM by sebastian
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:4 Changed on 06/03/2015 at 03:45:33 PM by sebastian
- Resolution set to fixed
- Status changed from reviewing to closed
comment:5 Changed on 06/08/2015 at 10:54:00 AM by sebastian
- Milestone set to Adblock-Plus-for-Firefox-next
Note: See
TracTickets for help on using
tickets.
https://hg.adblockplus.org/adblockplus/rev/9d1ca7d3a6a7