{"id":155,"date":"2004-11-10T12:52:20","date_gmt":"2004-11-10T10:52:20","guid":{"rendered":"http:\/\/frenchfragfactory.net\/ozh\/archives\/2004\/11\/10\/magpierss-vs-lastrss-comparison-of-php-rss-parsers\/"},"modified":"2005-04-22T15:37:27","modified_gmt":"2005-04-22T14:37:27","slug":"magpierss-vs-lastrss-comparison-of-php-rss-parsers","status":"publish","type":"post","link":"https:\/\/planetozh.com\/blog\/2004\/11\/magpierss-vs-lastrss-comparison-of-php-rss-parsers\/","title":{"rendered":"MagpieRSS vs LastRSS :  comparison of PHP RSS parsers"},"content":{"rendered":"<p>Some time ago I came across <a href=\"http:\/\/lastrss.webdot.cz\">LastRSS<\/a>, a PHP RSS parser which caught my attention because it looked a lot lighter (just one tiny file) than <a href=\"http:\/\/magpierss.sourceforge.net\">MagpieRSS<\/a>, the big gun of its category. So I decided to give LastRSS a try and went for some quick tests and benchmarks.<br \/>\nIs LastRSS powerful ? fast ? easy to use ? And compared to MagpieRSS, is it more powerful ? faster ? easier ?<br \/>\n<!--more--><\/p>\n<h2>Testing<\/h2>\n<p>I wanted to test how fast MagpieRSS and LastRSS can :<br \/>\n&#8211; include the requested php code into a page (the require_once part)<br \/>\n&#8211; fetch a remote feed<br \/>\n&#8211; parse and output data<br \/>\n&#8211; save a cached feed<br \/>\n&#8211; fetch a cached feed<\/p>\n<p>To do so, here is how I proceeded :<br \/>\n&#8211; I locally mirrored an example of a typical RSS feed (Slashdot&#39;s feed), to avoid my internet connexion latency<br \/>\n&#8211; I wrote this <a href=\"\/download\/rsstest\/rsstest.txt\">quick script<\/a> : starts timer, begin loop, fetches the feed, caches if applicable, loop if applicable, stops timers, displays result.<br \/>\n&#8211; I went on testing using cache and not using it, fetching several times the same feed.<\/p>\n<p>The fetching was done using the most simple and most default script configuration, with no fancy option.<\/p>\n<h2>Raw results<\/h2>\n<p>Here are the raw results : number of seconds it took to each PHP parser to parse a given number of time a feed, using their own cache feature or not.<\/p>\n<p><center><img decoding=\"async\" src=\"\/download\/rsstest\/rss_bench.jpg\" alt=\"MagpieRSS vs LastRSS\" class=\"img\" \/><\/center><\/p>\n<p>Line 1 shows the time needed to include code, fetch feed, parse data.<br \/>\nLine 2 shows the time needed to include code, fetch feed, parse data, fetch feed, parse data.<br \/>\nLine 5 shows the time needed to include code, fetch feed, parse data, write cached feed.<br \/>\nLine 6 shows the time needed to include code, fetch feed, parse data, write cached feed, fetch cached feed, parse data.<\/p>\n<p>What we can see is that LastRSS is a lot faster than MagpieRSS to include code and to fetch a remote feed. They are about equally fast to fetch, write and parse a cached feed.<\/p>\n<h2>Differences between the 2 parsers<\/h2>\n<p>Let&#39;s not conclude too fast : LastRSS is much faster, but it does a lot less. Parsing a <a href=\"\/download\/rsstest\/minislash.xml\">small fake feed<\/a> (a la Slashdot RSS, containing just one item), here are the print_r results of data collected by the two parsers :<br \/>\n&#8211; <a href=\"\/download\/rsstest\/lastrss_print_r.txt\">LastRSS<\/a><br \/>\n&#8211; <a href=\"\/download\/rsstest\/magpie_print_r.txt\">MagpieRSS<\/a><\/p>\n<p>As you can see, MagpieRSS parses virtually anything in the feed, even custom &lt;slash:stuff&gt; items, while LastRSS focuses mainly on &lt;title&gt;, &lt;link&gt; and &lt;description&gt;<\/p>\n<h2>Conclusion<\/h2>\n<p>If you can afford it, there are no real reason you shouldn&#39;t use MagpieRSS. For the average user&#39;s needs, Magpie does a lot more than you really need, but it does all that you do need.<\/p>\n<p>This said, there <em>are<\/em> situations you could consider using LastRSS as an effective alternative : for example, if you need extra fresh data (no cache), need to parse very often a loooot of feeds, have a weak server CPU wise, and need only data LastRSS collects (ie titles and links), it does look like a clever choice.<\/p>\n<h2>Conclusion of the conclusion<\/h2>\n<p>Ah. I always feel better when I write something serious on a completely futile subject :)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MagieRSS vs LastRSS : tests and benchmarks<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[2,1,10,63,73],"class_list":["post-155","post","type-post","status-publish","format-standard","hentry","tag-code","tag-my-life","tag-php","tag-review","tag-rss"],"_links":{"self":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts\/155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/comments?post=155"}],"version-history":[{"count":0,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/posts\/155\/revisions"}],"wp:attachment":[{"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/media?parent=155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/categories?post=155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/planetozh.com\/blog\/wp-json\/wp\/v2\/tags?post=155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}