[MacRuby-devel] MacRuby gems running very slow, how to debug/improve

Stian Håklev shaklev at gmail.com
Thu Mar 1 05:00:51 PST 2012


Hi Pim,

thank you very much for sharing this. However, one of the problems with
appscript is that it requires XCode to install, which many non-programmers
don't have installed (although it gets easier now that they separated the
command line compilers from the rest of the several gig XCode install). But
either way, there are other advantages of switching to MacRuby - for
example integrated global keyboard shortcuts (through a gem) - currently I
am using Keyboard Maestro for this, etc.

I really hope people could offer advice on how to help optimize these
libraries for MacRuby!

Stian

On Thu, Mar 1, 2012 at 07:26, Pim Snel <pim at lingewoud.nl> wrote:

> Hi Stian,
>
> We use the appscript gem for an Mac App we developed. To install appscript
> we ask for the Admin password and then we use a custom script to install
> every file we need. The objc method that calls the Sudo Dialog when files
> are missing is printer below. Their should be a ruby way to do this. I
> attached a shell script that installs the appscript gems and the sqlite
> gems.
>
> It works great for us.
>
> Kind regards,
> Pim Snel
> pas3.com
>
> // checkAppScript checks if the appscript binary are installed. If not it
> tries to install
>  - (void) checkAppScript
> {
>     NSLog(@"Authorization Start");
>     NSFileManager *fileManager = [[NSFileManager alloc] init];
>
>     if(![fileManager fileExistsAtPath:@
> "/Library/Ruby/Site/1.8/universal-darwin11.0/ae.bundle"]){
>
>         AuthorizationRef authorizationRef;
>         OSStatus status;
>
>         status = AuthorizationCreate(NULL,
> kAuthorizationEmptyEnvironment,kAuthorizationFlagDefaults,
> &authorizationRef);
>
>         NSString* installAppScriptScriptTmp = [railsRootDir
> stringByAppendingString:@"/lib/refxPrerequisitesInstall.sh"];
>         const char *installTool = [installAppScriptScriptTmp UTF8String];
>         char *tool_args[] = {};
>         //[installAppScriptScriptTmp release];
>
>         status = AuthorizationExecuteWithPrivileges(authorizationRef,
> installTool,kAuthorizationFlagDefaults, tool_args, NULL);
>
>         NSLog(@"Authorization Result Code: %d", status);
>         // Check for status TODO
>     }
>
>     [fileManager release];
> }
>
>
>
> Op 28 feb. 2012, om 17:02 heeft Stian Håklev het volgende geschreven:
>
> Hi all,
> I use a bunch of Ruby Script and appscript-rb, together with a stand-alone
> keyboard shortcut app to integrate a number of Mac apps. (
> http://reganmian.net/wiki/researchr:start). I am very interested in the
> possibility of porting this to MacRuby, because currently my biggest
> problem is the difficult other users have in installing this workflow
> (requiring XCode, binary gems, other applications etc).
>
> However, the two gems that I am absolutely dependent on are bibtex-ruby
> and citeproc-ruby. These both run extremely slowly on MacRuby. As a very
> simple example, here are the differences in running a script that only
> includes the lines
> include 'rubygems'
> include 'bibtex' (or 'citeproc')
>
> Ruby MRI 1.92p80: 0.18 and 0.36
> MacRuby 0.12: 2.88 and .677
>
> Running the parsing benchmarks for BibTeX in MacRuby is also 20-100 times
> slower. This makes it unusable for my purposes.
>
> I wonder how I can address this. The developer asked me for ruby-prof
> output, but I know that doesn't currently run on MacRuby. I have XCode and
> Instruments, but having never used XCode for ObjC development, I have no
> idea about how to configure Instruments to make it useful for his purposes.
> Any assistance would be greatly appreciated!
>
> Stian Haklev
> Curriculum, Teaching and Learning / University of Toronto
>
> --
> http://reganmian.net/blog -- Random Stuff that Matters
>
>  _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>


-- 
http://reganmian.net/blog -- Random Stuff that Matters
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20120301/7440ef48/attachment-0001.html>


More information about the MacRuby-devel mailing list