Make WordPress Core

Opened 18 years ago

Closed 18 years ago

Last modified 17 years ago

#2978 closed defect (bug) (fixed)

remove_accents is a hog

Reported by: skeltoac's profile 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)

remove_accents-faster.diff (416 bytes) - added by skeltoac 18 years ago.

Download all attachments as: .zip

Change History (4)

#1 @ryan
18 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [4050]) Faster remove accents. Props skeltoac. fixes #2978

#2 @ryan
18 years ago

(In [4052]) Faster remove accents. Props skeltoac. fixes #2978

#3 @(none)
17 years ago

  • Milestone 2.0.4 deleted

Milestone 2.0.4 deleted

Note: See TracTickets for help on using tickets.