[wp-trac] [WordPress Trac] #14429: Faster is_serialized
WordPress Trac
wp-trac at lists.automattic.com
Fri Jul 30 02:48:27 UTC 2010
#14429: Faster is_serialized
--------------------------+-------------------------------------------------
Reporter: sambauers | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Optimization | Version: 3.0
Severity: minor | Keywords: has-patch
--------------------------+-------------------------------------------------
Comment(by sambauers):
Replying to [comment:2 Denis-de-Bernardy]:
> See also #9930 for simple optimizations and fixes that never got
committed.
The proposal in #9930 is a hammer, is_serialized() is not a nail. There's
a serious case of regex fever going on there. "Elegance" over
performance. Although I note your concerns about performance in the
comments there.
It's not necessary to check for serialised doubles on every call of
is_serialized(), only if it passes the rudimentary tests for a serialised
string. On a standard install is_serialzed() runs about 1700 times per
page (from memory). Maybe not even half of those calls are examining
serialised strings at all.
Where possible, commonly used functions should exit or return as quickly
and as cheaply as possible. That's what I'm doing here. The serialised
doubles problem should be a discreet case after that, not tied into the
rudimentary checks.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14429#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list