Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#10147 closed enhancement (fixed)

Improve SimplePie memory usage

Reported by: link92's profile link92 Owned by: denis-de-bernardy's profile Denis-de-Bernardy
Milestone: 2.8.1 Priority: normal
Severity: normal Version: 2.8
Component: Performance Keywords: has-patch needs-review
Focuses: Cc:

Description

If we are to use SimplePie for importers (see #7400, for example, but also the RSS, Blogger, etc. importers), then the memory usage of the version included in 2.8 will be problematic. We should probably backport changes between r1032 and r1036 of SimplePie. Attached is a patch that does this.

Attachments (2)

sp.diff (4.0 KB) - added by link92 15 years ago.
sp.2.diff (4.1 KB) - added by link92 15 years ago.
Better patch, now including r1042

Download all attachments as: .zip

Change History (14)

@link92
15 years ago

#2 @Denis-de-Bernardy
15 years ago

  • Component changed from General to Performance
  • Owner set to Denis-de-Bernardy

#3 @Denis-de-Bernardy
15 years ago

  • Keywords has-patch needs-review added

failed to find their revision log, for reference.

#6 follow-up: @Denis-de-Bernardy
15 years ago

Thanks. Out of curiosity, do you know why they're not using php's built-in parse_url() function?

http://bugs.simplepie.org/repositories/diff/sp1/trunk/simplepie.inc?rev=1036

#8 in reply to: ↑ 6 @link92
15 years ago

Replying to Denis-de-Bernardy:

Thanks. Out of curiosity, do you know why they're not using php's built-in parse_url() function?

http://bugs.simplepie.org/repositories/diff/sp1/trunk/simplepie.inc?rev=1036

We don't, because, uh… um, I wrote that code years ago? I think the answer is something along the lines of a few things in the manual:

  • "Invalid characters are replaced by _." (This goes against what is needed for web compat.)
  • "On seriously malformed URLs, parse_url() may return FALSE and emit a E_WARNING." (We want to break up everything before we try and make it valid, again for web compat.)
  • "This function doesn't work with relative URLs." (Yeah, we parse those a lot, turning relative URIs into absolute ones.)

If the manual is wrong on all three things I'll remove our own parse_url. :)

#9 @link92
15 years ago

Also, the parse_url() function will go in SP 1.2 eventually, as everything will move over to the IRI class (actually, more likely the parse_url() will remain for backwards compatibility and just call the IRI class).

@link92
15 years ago

Better patch, now including r1042

#10 @ryan
15 years ago

  • Milestone changed from 2.9 to 2.8.1

#11 @ryan
15 years ago

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

(In [11599]) Reduce SimplePie memory usage. Props link92. fixes #10147 for trunk

#12 @ryan
15 years ago

(In [11600]) Reduce SimplePie memory usage. Props link92. fixes #10147 for 2.8.1

Note: See TracTickets for help on using tickets.