[wp-trac] [WordPress Trac] #17177: Optimize parse_request for the home page (empty request)
WordPress Trac
wp-trac at lists.automattic.com
Tue Apr 19 14:56:16 UTC 2011
#17177: Optimize parse_request for the home page (empty request)
--------------------------+-----------------------------
Reporter: duck_ | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Performance | Version:
Severity: normal | Keywords: has-patch
--------------------------+-----------------------------
When you visit a site's home page the request (WP::$request) is empty.
However we still try to match it against every rewrite rule. By default
none of the rules will match. This can be particularly bad when verbose
page rules are enabled and WordPress is attempting 700+ regex matches (~50
pages) or more for especially large page oriented sites on an empty
string.
The only reason against breaking from the loop like we do for wp-app.php
in this case I could think of is if a plugin has added an extra rule to
match `^$`.![1] If we want to allow this then maybe manually check for a
rule == `$` and still break early.
![1] This can currently be blocked by #17176 as `()(/[0-9]+)?/?$` matches
an empty string
--
Ticket URL: <http://core.trac.wordpress.org/ticket/17177>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list