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)


ElemHide.getSelectorsForDomain() is using a 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:3 Changed on 06/03/2015 at 11:11:21 AM by sebastian

  • Description modified (diff)

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

Add Comment

Modify Ticket

Change Properties
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from sebastian.
Note: See TracTickets for help on using tickets.