Opened on 10/28/2014 at 06:48:35 PM
Closed on 10/30/2014 at 01:05:08 PM
#1502 closed change (fixed)
Cache translation catalogs on Safari
Reported by: | sebastian | Assignee: | sebastian |
---|---|---|---|
Priority: | P3 | Milestone: | Adblock-Plus-1.8.8-for-Chrome-Opera-Safari |
Module: | Platform | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Platform: | Unknown | |
Ready: | yes | Confidential: | no |
Tester: | Verified working: | no | |
Review URL(s): |
Description (last modified by sebastian)
Background
Since Safari doesn't come with an i18n system for extensions, we ported Chrome's i18n API using synchronous XMLHttpRequests to load the catalogs. Initially I decided to send a new XMLHttpRequest for every translated text, in order to keep things simple and to avoid unnecessary memory usage.
However, it turned out that those requests, despite they just load local files from the extension bundle, take up to 400ms (on my Mac Mini). This is per translated text and the time for parsing the catalogs still comes on top.
Initially I didn't consider that code a hotspot, but it kinda is one. Every time a request is blocked, parts of the popup UI are updated, included the translations used there. And as opposed to Chrome, the popup on Safari is also running if hidden. And since the popup runs in the same thread as the background page, all code running in the popup can delay requests processed by the background page.
What to change
Cache the loaded and parsed translation catalogs on Safari.
Attachments (0)
Change History (3)
comment:1 Changed on 10/28/2014 at 06:50:11 PM by sebastian
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:3 Changed on 10/30/2014 at 01:05:08 PM by sebastian
- Milestone set to Adblock-Plus-for-Chrome-Opera-Safari-next
- Resolution set to fixed
- Status changed from reviewing to closed
https://hg.adblockplus.org/adblockpluschrome/rev/5082cf7bbe6e