<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" > <channel><title>Comments on: Fast min/max in arrays</title> <atom:link href="http://www.javascriptrules.com/2009/09/23/fast-minmax-in-arrays/feed/" rel="self" type="application/rss+xml" /><link>http://www.javascriptrules.com/2009/09/23/fast-minmax-in-arrays/</link> <description></description> <lastBuildDate>Mon, 30 Aug 2010 17:44:21 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.2</generator> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>By: fpiat</title><link>http://www.javascriptrules.com/2009/09/23/fast-minmax-in-arrays/comment-page-1/#comment-39</link> <dc:creator>fpiat</dc:creator> <pubDate>Sun, 22 Nov 2009 14:35:32 +0000</pubDate> <guid isPermaLink="false">http://www.javascriptrules.com/?p=213#comment-39</guid> <description>I’m running FF 3.5.3 too and also get other results: - the optmized for is always the faster - as the array grows the Math.max take more and more time and became the slower</description> <content:encoded><![CDATA[<p>I’m running FF 3.5.3 too and also get other results:<br /> - the optmized for is always the faster<br /> - as the array grows the Math.max take more and more time and became the slower</p> ]]></content:encoded> </item> <item><title>By: MarcusT</title><link>http://www.javascriptrules.com/2009/09/23/fast-minmax-in-arrays/comment-page-1/#comment-17</link> <dc:creator>MarcusT</dc:creator> <pubDate>Wed, 30 Sep 2009 03:01:47 +0000</pubDate> <guid isPermaLink="false">http://www.javascriptrules.com/?p=213#comment-17</guid> <description>I&#039;m running FF 3.5.3 and also get disappointing results (virtually identical every time): &lt;pre&gt;Array creation:	161	ms For loop:	13	ms Optmized for:	14	ms Math.max:	21	ms&lt;/pre&gt;Even so, the one liner is infinitely preferable in use to the alternatives.</description> <content:encoded><![CDATA[<p>I&#8217;m running FF 3.5.3 and also get disappointing results (virtually identical every time):</p><pre>Array creation:	161	ms
For loop:	13	ms
Optmized for:	14	ms
Math.max:	21	ms</pre><p>Even so, the one liner is infinitely preferable in use to the alternatives.</p> ]]></content:encoded> </item> <item><title>By: Marcel Duran</title><link>http://www.javascriptrules.com/2009/09/23/fast-minmax-in-arrays/comment-page-1/#comment-16</link> <dc:creator>Marcel Duran</dc:creator> <pubDate>Thu, 24 Sep 2009 14:54:56 +0000</pubDate> <guid isPermaLink="false">http://www.javascriptrules.com/?p=213#comment-16</guid> <description>Thanks Karl,The problem with Chrome and Safari is likely to be related to Webkit engine. That test page has a default array size of one million random numbers which is too much for those browsers. They complain either about &lt;code&gt;apply&lt;/code&gt; not supporting one million arguments or maximum call stack size exceeded. I&#039;ve updated that page adding a try/catch block showing the error message when error occurs. If you reduce the array size, let&#039;s say to 100 thousand it works on those browsers but with a much worse performance.</description> <content:encoded><![CDATA[<p>Thanks Karl,</p><p>The problem with Chrome and Safari is likely to be related to Webkit engine. That test page has a default array size of one million random numbers which is too much for those browsers. They complain either about <code>apply</code> not supporting one million arguments or maximum call stack size exceeded.<br /> I&#8217;ve updated that page adding a try/catch block showing the error message when error occurs. If you reduce the array size, let&#8217;s say to 100 thousand it works on those browsers but with a much worse performance.</p> ]]></content:encoded> </item> <item><title>By: Karl</title><link>http://www.javascriptrules.com/2009/09/23/fast-minmax-in-arrays/comment-page-1/#comment-15</link> <dc:creator>Karl</dc:creator> <pubDate>Thu, 24 Sep 2009 12:52:52 +0000</pubDate> <guid isPermaLink="false">http://www.javascriptrules.com/?p=213#comment-15</guid> <description>That&#039;s a quite an interesting snippet but for some reason I didn&#039;t get the same results on FireFox 3.5(.3).For loop:	15	ms Optmized for:	13	ms Math.max:	22	msSo I decided to test this on some other browsers and IE 6 - 8 as well as Opera 10 showed significantly faster speeds on Math.max.apply. However the method does not work with Chrome or Safari.</description> <content:encoded><![CDATA[<p>That&#8217;s a quite an interesting snippet but for some reason I didn&#8217;t get the same results on FireFox 3.5(.3).</p><p>For loop:	15	ms<br /> Optmized for:	13	ms<br /> Math.max:	22	ms</p><p>So I decided to test this on some other browsers and IE 6 &#8211; 8 as well as Opera 10 showed significantly faster speeds on Math.max.apply. However the method does not work with Chrome or Safari.</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)

Served from: www.javascriptrules.com @ 2010-09-07 08:10:07 -->