[MacRuby-devel] Speed

Joshua Ballanco jballanc at gmail.com
Wed Dec 21 12:17:48 PST 2011


2011/12/20 François Boone <francois.boone at usherbrooke.ca>

> Hi,
>
> I have written a function with 461 queries in a MySQL database.
> With macirb, it takes more or less 1s for all queries.
> I put my file in a Xcode project and when I click on a button, the action
> is to run this function.
> However, it takes more or less 1s for EACH query!
> I use normal schedule, not deployment as explained in the definitive guide,
> (I don't want give the exact title to not make advertisement  in a post
> lol )
>
> What's wrong?
>

Hi François,

Can you give a bit more context, perhaps? In macirb, are you loading a file
with the function or entering it at the prompt? In Xcode, do the queries
result from a pure ruby file, or are you doing a ruby call from Obj-C? What
libraries/gems are you using to connect to MySQL? Is there an 'eval' call
involved in making the queries?

To be honest, things should be much faster from Xcode, since macruby_deploy
will compile all of your ruby sources to .rbo files. The exception would be
if your code contains copious use of "eval". It is also possible that you
have stumbled on a perf bug (the best kind of bug, IMHO), in which case it
would be great if you could reduce the code down to something minimal that
other devs could run locally.

Cheers,

Josh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20111221/2604bc31/attachment.html>


More information about the MacRuby-devel mailing list