<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr</title>
<link>http://snipplr.com/tags/speedtest</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Wed, 22 May 2013 08:47:13 GMT</pubDate>
<item>
<title>(PHP) Speed Test: array_push vs $array[] - mthorn</title>
<link>http://snipplr.com/view/759/speed-test-arraypush-vs-array/</link>
<description><![CDATA[ <p>Took 0.164692 seconds for array[]
Took 0.395778 seconds for array_push

As you can see array_push is more than twice as slow. Here are the reasons. Array_push is a function call, Function calls are always slower. Array_push takes mixed parameters, parameter checking is always slower. Also array[] just looks cleaner and is less to type.

Tips: Always pre-intialize your variables and don't use mixed types even though you can.</p> ]]></description>
<pubDate>Wed, 09 Aug 2006 09:27:46 GMT</pubDate>
<guid>http://snipplr.com/view/759/speed-test-arraypush-vs-array/</guid>
</item>
<item>
<title>(PHP) Speed Test: strcmp vs === - mthorn</title>
<link>http://snipplr.com/view/758/speed-test-strcmp-vs-/</link>
<description><![CDATA[ <p>strcmp with matching strings took 0.207852 seconds
strcmp with non-matching strings took 0.215276 seconds
=== with matching strings took 0.067122 seconds
=== with non-matching strings took 0.057305 seconds

=== is the clear winner. Function calls are always slower than operators. This was with PHP5, may be different for earlier versions. Not sure about the memory impact but I assume it's less since the strings do not have to be copied for the function call.</p> ]]></description>
<pubDate>Wed, 09 Aug 2006 09:23:15 GMT</pubDate>
<guid>http://snipplr.com/view/758/speed-test-strcmp-vs-/</guid>
</item>
</channel>
</rss>