#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)
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 to
- Status new → assigned
Love it. Applied it and haven't noticed any problems.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Looks great!