Please multithread ABP using WebWorkers

Various discussions related to Adblock Plus development
Post Reply
lukehutch
Posts: 2
Joined: Thu Aug 13, 2015 9:53 am

Please multithread ABP using WebWorkers

Post by lukehutch »

When opening many tabs simultaneously (e.g. when restarting Chrome after a crash), most of the tabs get pegged with a message at the bottom, "Waiting for extension AdBlockPlus". I assume that means that only one instance of ABP can be active at a given time. It would be great if the pattern matching in ABP could be offloaded to WebWorkers, so that Chrome doesn't get blocked in this way.
snoack
Posts: 162
Joined: Tue Aug 13, 2013 7:45 pm

Re: Please multithread ABP using WebWorkers

Post by snoack »

That approach isn't feasible as the communication with web workers has to go through asynchronous messaging. This introduces two problems:

1. Each web worker would need an own copy of the filter data, significantly increasing the memory footprint.
2. The webRequest API requires a synchronous response in order to decide whether to block a request or not, hence you cannot delegate to a web worker.
Post Reply