#2548 closed enhancement (fixed)
ent2ncr is very, very slow
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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)
Change History (8)
#2
@
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
@
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.
Note: See
TracTickets for help on using
tickets.
Looks great!