#17129 closed enhancement (fixed)
Speed up is_serialized_string()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.2 |
| Component: | Performance | Version: | |
| Severity: | minor | Keywords: | reporter-feedback |
| Cc: |
Description
is_serialized_string() uses an expensive regular expression. It should use substring peeking like is_serialized() does. In my tests, this offers a time reduction of about 26%.
Attachments (2)
Change History (9)
markjaquith
— 2 years ago
comment:2
markjaquith
— 2 years ago
- Owner set to markjaquith
- Resolution set to fixed
- Status changed from new to closed
In [17779]:
comment:4
hakre
— 2 years ago
- Keywords reporter-feedback added
When I reviewed the changeset this is what came into my mind. I have not benchmarked so far if it's actually faster than the if / else approach.
Note: See
TracTickets for help on using
tickets.
Edit: Oops, Ignore What I've said...
the last elseif can be changed to
elseif ( '"' !== $data[4] || '"' !== $data[$length-2] ) return false;