Make WordPress Core

Opened 20 years ago

Closed 20 years ago

Last modified 19 years ago

#2548 closed enhancement (fixed)

ent2ncr is very, very slow

Reported by: random's profile random Owned by: markjaquith's profile markjaquith
Milestone: Priority: low
Severity: normal Version: 2.0.1
Component: Optimization Keywords: bg|has-patch
Focuses: Cc:

Description

I was playing with a profiler this afternoon, and was surprised to see that 10% of the request execution time was being spent on ent2ncr(). That's incredibly high.

The patch I'm about to attach replaces the 250+ str_replace() calls with a single one, which seems to be around 5-30x faster in real-world situations. The speed difference decreases as the length of text parsed increases. It was just a bit ahead at ~40,000 words of text, and the profiler choked on anything more.

Attachments (1)

ent2ncr.diff (472 bytes) - added by random 20 years ago.

Download all attachments as: .zip

Change History (8)

@random
20 years ago

#1 @skeltoac
20 years ago

Looks great!

#2 @davidhouse
20 years ago

  • Keywords bg|has-patch added

Yeah, nicely spotted. I doubt anyone will be publishing 40,000 word essays, so your patch looks brilliant. When I get home I'll test the patch then bg|commit it, if no-one else has done already.

#3 @markjaquith
20 years ago

  • Owner changed from anonymous to markjaquith
  • Status changed from new to assigned

Love it. Applied it and haven't noticed any problems.

#4 @ryan
20 years ago

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

(In [3641]) ent2ncr optimization. Props random. fixes #2548

#5 @ryan
20 years ago

  • Milestone changed from 2.1 to 2.0.3

Reopen for 2.0.3 inclusion.

#6 @ryan
20 years ago

  • Resolution set to fixed

(In [3742]) ent2ncr optimization. Props random. fixes #2548

#7 @(none)
19 years ago

  • Milestone 2.0.3 deleted

Milestone 2.0.3 deleted

Note: See TracTickets for help on using tickets.