From: Anders Bengtsson Date: 2002-11-21T21:14:39+09:00 Subject: Re: Ruby is too slow MetalOne wrote: > I like Ruby, but it needs to be significantly faster. > Anybody know the main reason why Ruby is so much slower in this example. > Is it the handling of numbers? > Is there overhead calling yield for every pixel? > Is the array lookup not O(1)? Try to run your code with the ruby profiler (using "ruby -rprofile yourcode.rb"). That should find where most time is spent, and you can then either try to optimize that part, or implement it as a C library for ruby. It may well be that it is still too slow for your purposes, since C++ and java in general are faster than ruby. But at least you'll have more information to make the right decision. /Anders -- A n d e r s B e n g t s s o n | ndrsbngtssn@yahoo.se Stockholm, Sweden | _____________________________________________________ Gratis e-mail resten av livet p� www.yahoo.se/mail Busenkelt!