From: Dmitry Nikiforov Date: 2012-02-04T03:12:02+09:00 Subject: Re: Basic Ruby performance Josh Cheek wrote in post #1043970: > It creates a Range, which just iterates, not an array. A more idiomatic > way > would probably be (1+10**8).times { ... } Phew... :) > As an aside, if all the processing is happening in the loop, then it > might > make more sense that the loop just delegates work out to other processes > (e.g. parse a line or process a parsed set of data). This could be > pretty > simple if done with a thread pool in a single Ruby script (you'll want > one > of the alternate implementations here since you're CPU bound and MRI has > a > GIL), or as arbitrarily complex as you like. Yeah, that's how it works in my Perl version - it all runs on Amazon, with workload delegated to "worker" servers in a MapReduce-like fashion, using Redis for inter-server communication. -- Posted via http://www.ruby-forum.com/.