Opened 4 years ago

Closed 4 years ago

#2177 closed change (fixed)

Optimize filter matching performance by performing regexp match last

Reported by: sebastian Assignee: sebastian
Priority: P3 Milestone: Adblock-Plus-2.6.9-for-Firefox
Module: Core Keywords:
Cc: trev Blocked By:
Blocking: Platform: Unknown
Ready: yes Confidential: no
Tester: Verified working:
Review URL(s):

http://codereview.adblockplus.org/6603225352372224

Description

Background

Slow regular expressions can easily kill the filter matching performance, even if the request type or document domain doesn't match. Hence we should change the order of checks when matching filters, perfoming the less expensive checks first.

What to change

Change the implementation of Filter.matches(), to first match request type, third party and document domain. And perform the the regexp match last only if all other tests passed.

Change History (4)

comment:1 Changed 4 years ago by sebastian

  • Summary changed from Optimize filter matching by performing regexp match last to Optimize filter matching performance by performing regexp match last

comment:2 Changed 4 years ago by trev

  • Cc trev added
  • Priority changed from Unknown to P3
  • Ready set

comment:3 Changed 4 years ago by sebastian

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:4 Changed 4 years ago by sebastian

  • Milestone set to Adblock-Plus-for-Firefox-next
  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.