Changes between Version 2 and Version 3 of Ticket #6465, comment 9


Ignore:
Timestamp:
05/14/2018 07:10:42 PM (2 years ago)
Author:
sebastian
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6465, comment 9

    v2 v3  
    11FWIW, I think we can optimize the matching algorithm (using a binary tree) to the point that any caching on-top wouldn't give any performance benefits anymore (even in plain JavaScript). I wrote a proof-of-concept a while ago, but didn't have any time recently to move it forward. 
    22 
    3 Anyway, [attachment:parser.js here] is my proof-of-concept. When you run the script with nodejs you can pass in filter data on stdin. On my machine it matches a URL against all of EasyList in ~1ms, while maintaining a moderate memory footprint (since with this approach we don't have to create a RegExp object for each filter). This approach might be more promising than an optimization to the caching logic. 
     3Anyway, [attachment:parser.js here] is my proof-of-concept. When you run the script with nodejs you can pass in filter data on stdin. On my machine it matches a URL against all of EasyList in ~1ms, while maintaining a moderate memory footprint (since with this approach we don't have to create a RegExp object for each filter). Perhaps this approach might be more promising than an optimization to the caching logic.