Make WordPress Core

Opened 21 years ago

Closed 21 years ago

Last modified 20 years ago

#2548 closed enhancement (fixed)

ent2ncr is very, very slow

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

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 21 years ago.

Download all attachments as: .zip

Change History (8)

#1 @skeltoac
21 years ago

Looks great!

#2 @davidhouse
21 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
21 years ago

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

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

#4 @ryan
21 years ago

  • Resolution → fixed
  • Status assigned → closed

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

#5 @ryan
21 years ago

  • Milestone 2.1 → 2.0.3

Reopen for 2.0.3 inclusion.

#6 @ryan
21 years ago

  • Resolution → fixed

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

#7 @(none)
20 years ago

  • Milestone 2.0.3

Milestone 2.0.3 deleted

Note: See TracTickets for help on using tickets.