Closed Bug 905607 Opened 11 years ago Closed 11 years ago

(abp) IO.readFromFile() on the main thread causes 800ms jank at startup (INIParser)

Categories

(Firefox :: Untriaged, defect)

26 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: jean.claveau, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0 (Beta/Release)
Build ID: 20130814141812

Steps to reproduce:

+ Install adblock plus and configure filters
+ Profile firefox at startup


Actual results:

Abp parses filters from INI on the main thread causing two big janks (500ms + 300ms on my laptop).

http://people.mozilla.com/~bgirard/cleopatra/#report=21cfdf8c4beeb0e497051c27fedb0835a550e5a1



Expected results:

This parse should be off the main thread (using the new OS.File api I guess).

I'm not an addon dev but it looks like an issue from adblock and not addon-sdk.




I found : 
+ https://adblockplus.org/jsdoc/adblockplus/symbols/INIParser.html
+ https://adblockplus.org/jsdoc/adblockplus/symbols/src/lib_filterStorage.js.html
+ https://adblockplus.org/jsdoc/adblockplus/symbols/src/lib_io.js.html
+ https://developer.mozilla.org/en-US/docs/JavaScript_OS.File
I've opened a bug report on abp forum here : https://adblockplus.org/forum/viewtopic.php?f=11&t=17216
Blocks: abp
(In reply to Jean Claveau from comment #0)
> Abp parses filters from INI on the main thread causing two big janks (500ms + 300ms on my laptop).
>
> http://people.mozilla.com/~bgirard/cleopatra/#report=21cfdf8c4beeb0e497051c27fedb0835a550e5a1

This report shows Adblock Plus saving filters, not reading them.

> This parse should be off the main thread (using the new OS.File api I guess).

Unless I misunderstand something you are wrong. The OS.File API allows *reading* files off the main thread - but Adblock Plus does that already, IO.readFromFile() is asynchronous.

The *parsing* however still has to happen on the main thread. It could happen in a worker off the main thread - but that worker would produce tons of objects as a result that would need to be sent to the main thread. The overhead would kill any advantage you could gain from that solution.

IMHO the only solution here is speeding up the processing of data. This is what I looked into (https://adblockplus.org/blog/thoghts-on-using-asmjs-for-performance-bottlenecks-in-browser-extensions, particularly the reply to comment by Jesse Ruderman) but so far I didn't have time to continue that research.

I'm resolving this as INVALID because I'm pretty certain that there is no Firefox bug involved. Let's continue in the Adblock Plus forum which is the right place for this.
No longer blocks: abp
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.