Received: by 10.52.174.114 with SMTP id br18mr7854203vdc.2.1324510530783; Wed, 21 Dec 2011 15:35:30 -0800 (PST) X-BeenThere: nodejs@googlegroups.com Received: by 10.52.173.234 with SMTP id bn10ls12566849vdc.3.gmail; Wed, 21 Dec 2011 15:35:23 -0800 (PST) Received: by 10.52.92.234 with SMTP id cp10mr1484521vdb.6.1324510523610; Wed, 21 Dec 2011 15:35:23 -0800 (PST) Date: Wed, 21 Dec 2011 15:35:23 -0800 (PST) From: Tristan Reply-To: nodejs@googlegroups.com To: nodejs@googlegroups.com Message-ID: <29273239.136.1324510523306.JavaMail.geo-discussion-forums@yqbo42> In-Reply-To: References: <11039007.361.1324508025015.JavaMail.geo-discussion-forums@yqir6> Subject: Re: [nodejs] process.nextTick performance question MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_134_4134764.1324510523305" ------=_Part_134_4134764.1324510523305 Content-Type: multipart/alternative; boundary="----=_Part_135_1764877.1324510523305" ------=_Part_135_1764877.1324510523305 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Wow! #1 was a huge difference. I thought I took care of closures by generating them both in the loop and process.nextTick, but removing them per your response made a significant difference. This is much more along the lines of what I expected. Results using benchmark without closures: loop result: 22ms nextTick result: 178ms Benchmark without closures : https://gist.github.com/1508208 Thanks Ben, that's a much more encouraging result. ------=_Part_135_1764877.1324510523305 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Wow! #1 was a huge difference.

I thought I took care of closures by generating them both in the loop and process.nextTick, but removing them per your response made a significant difference. This is much more along the lines of what I expected. 

Results using benchmark without closures:
loop result: 22ms
nextTick result: 178ms

Benchmark without closures : https://gist.github.com/1508208

Thanks Ben, that's a much more encouraging result.
------=_Part_135_1764877.1324510523305-- ------=_Part_134_4134764.1324510523305--