#2978 closed defect (bug) (fixed)
remove_accents is a hog
Reported by: | skeltoac | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.0.3 |
Component: | Optimization | Keywords: | |
Focuses: | Cc: |
Description
Profiling a page load with 61 remove_accents calls (sanitize_title does this) found that remove_accents was taking 86ms, or >1ms per call.
I added this to remove_accents as a first line:
if ( !preg_match('/[\x80-\xff]/', $string) ) return $string;
This reduced the total execution time to 1.8ms, or 0.03ms per call. Nice savings.
Attachments (1)
Change History (4)
Note: See
TracTickets for help on using
tickets.
(In [4050]) Faster remove accents. Props skeltoac. fixes #2978