[development] PHP 5 > aggregator.module rewrite to XML API?
Morbus Iff
morbus at disobey.com
Tue Jun 19 16:33:58 UTC 2007
> Unfortunately, we can't take these statistics as canon:
>
> * there's no instructions on how to duplicate.
>
> * the SimplePie result is an estimate ("At SimplePie I have to
> do an estimate, because the feed download time was accumulated
> to the measure."
>
> * it is unknown whether the other feed parsers are doing the
> same sanitization that SimplePie does, again, which adds
> more time to the results.
I have done some quick tests, using the same URL as Aron:
http://www.christiannewswire.com/rss/catfeed_2.xml
I downloaded this file to my desktop. I will be passing this string into
SimplePie instead of allowing SimplePie to download it. The file is 1M:
1027320 Jun 19 11:50 catfeed_2.xml
This is the script I used with SimplePie 1.0 b3.2 (20061124):
<?php
$handle = fopen('./catfeed_2.xml', "r");
$contents = fread($handle, filesize('./catfeed_2.xml'));
require './simplepie.inc';
$feed = new SimplePie();
$feed->set_raw_data($contents);
$feed->init();
$parsed = $feed->get_items();
?>
With this command line:
~/Desktop > date && php simplepie.php && date
Tue Jun 19 12:26:10 EDT 2007
Tue Jun 19 12:26:22 EDT 2007
As you can see, this does confirm the 10 or 12 second parse time -- it
is also using all the sanitation that SimplePie does by default.
However, SimpleFeed and FeedParser both ship with the latest development
version of SimplePie which includes an option to stop this sanitation:
$feed->set_stupidly_fast(TRUE);
I grabbed today's development version, added the above
line before the ->init() in the above script, and reran:
~/Desktop > date && php simplepie.php && date
Tue Jun 19 12:28:54 EDT 2007
Tue Jun 19 12:28:55 EDT 2007
You'll notice that it is only 1 second which removes all doubt in my
mind that SimplePie is a bad thing comparitively (since one would assume
you'd sanitize the data as necessary within Drupal).
--
Morbus Iff ( and think about the bad things that I didn't do )
Technical: http://www.oreillynet.com/pub/au/779
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
aim: akaMorbus / skype: morbusiff / icq: 2927491 / jabber.org: morbus
More information about the development
mailing list