Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(510)

Unified Diff: chrome/common/extensions/docs/templates/intros/events.html

Issue 13523005: Performance guidelines for decl. WebRequest API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/docs/templates/intros/declarativeWebRequest.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/templates/intros/events.html
diff --git a/chrome/common/extensions/docs/templates/intros/events.html b/chrome/common/extensions/docs/templates/intros/events.html
index 8c4156ce19f288c5b8c16d52904c310ec1a57496..19fbabf9be4b12188b8070acfbed9ca86954d4fc 100644
--- a/chrome/common/extensions/docs/templates/intros/events.html
+++ b/chrome/common/extensions/docs/templates/intros/events.html
@@ -164,6 +164,24 @@ function getRules(rule_ids, function callback(details) {...});
The <code>details</code> parameter passed to the <code>callback()</code> function
refers to an array of rules including filled optional parameters.
</p>
+
+<h3 id="performance">Performance</h3>
+
+<p>
+To achieve maximum performance, you should keep the following guidelines in
+mind:
Mike West 2013/04/08 13:52:53 These are excellent tips: I think they'd be even m
battre 2013/04/08 14:42:55 Done.
+<ul>
+ <li>Register and unregister rules in bulk. After each
+ registration or unregistration, Chrome needs to update internal data
+ structures. This update is an expensive operation.
+ <li>Prefer substring matching over matching using regular expressions in a
+ $ref:events.UrlFilter. Substring based matching is extremely fast.
+ <li>If you have many rules that all share the same actions, you may merge
+ the rules into one because rules trigger their actions as soon as a single
+ condition is fulfilled. This speeds up the matching and reduces memory
+ consumption for duplicate action sets.
+</ul>
+</p>
</div>
{{/is_apps}}
« no previous file with comments | « chrome/common/extensions/docs/templates/intros/declarativeWebRequest.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698