Compile ruby script for faster use

I have a ruby script of around 2200 lines which is being used repeatedly, so is there a way to convert it into binary or compile it so it runs faster.

-------------Problems Reply------------

It seems that only JRuby has a compiler which is good news if Java is your target platform and no help if not.

Perhaps you could re-architect your solution to include the Ruby interpreter in a pipeline so that your script can be launched once and run continually as it receives input?

If you are using MRI, your best bet is to optimize your code as the JIT compilation already delivers proven performance. You can also switch to 1.9 version as it is faster in various cases.

Category:ruby Views:1 Time:2012-02-09

Related post

  • Compile ruby script into exe? 2012-04-03

    Is it possible to compile a ruby script into an .exe on Windows? I have searched everywhere and I've tried the following (It looked like RubyScript2EXE, Shoes and Crate all seemed dead or abandoned.): http://ocra.rubyforge.org/ http://exerb.sourcefor

  • Can ruby scripts be precompiled into a binary? 2011-04-13

    I'm working on a Ruby script that will need to be deployed onto systems without a ruby interpreter. It will need to run on FreeBSD systems which uses the ELF format. I know there is a ruby2exe project to compile ruby scripts to run on Windows, but is

  • How can I compile a standalone Ruby script into a standalone AOT compiled macruby executable? 2011-07-20

    How can I compile a standalone Ruby script into a standalone AOT compiled macruby executable? I would like to write a command line tool in MacRuby that can be distributed. --------------Solutions------------- macrubyc is your friend. The simple hello

  • How to compile a simple ruby script with macruby? 2013-02-18

    I'm trying to compile a simple "Hello World" ruby script to a Mac OS binary using macrubyc. This is the command I'm using: macrubyc -C hello_world.rb This is the output of the file command: file hello_world.rbo hello_world.rbo: Mach-O 64-bit bundle x

  • When aiming to AOT compile a ruby script with MacRuby is there any restriction on the language? 2010-02-01

    I am looking into using MacRuby and am interested in it's ability to AOT compile ruby code down to an executable. I am wondering though whether this places a restriction on the code in any way? Is there a subset of ruby which is supported or can i go

  • Will Ruby ever be *fast*? 2009-09-17

    Will Ruby ever see a performance boost as Javascript has seen recently? Can a new VM make it really, really, fast? Or do we have to assume all the benefits of Ruby have an inescapable performance penalty? What methods could be taken to improve its pe

  • Speeding up Ruby script startup in Windows or Cygwin 2009-02-27

    I've got a ruby script which takes about 30 seconds to startup. It takes that much because it tries to load all libraries and stuff. When I do ruby.exe -v it's instant. I don't want to touch the original ruby script, which is not written by me. What

  • Do you prefer compiled or scripted languages? 2009-04-15

    Since this is wide community using all kind of different technologies, it seems like appropriate place to ask this. Do you like to compile or do you prefer scripting? I ask this because I tend to program things in small scripting languages with chose

  • Is it possible to compile Ruby to byte code as with python? 2009-12-29

    In Python if i want to give out an app without sources i can compile it in bytecode .pyc, is there a way to do something like it in ruby? --------------Solutions------------- I wrote a much more detailed answer to this question over at the question C

  • Compiling Ruby and Python interpreters with Clang? 2010-03-06

    I'm just curious; are there any benchmarks about how compiling interpreters for dynamic languages with Clang affects the performance of these languages? Do those interpreters even compile? --------------Solutions------------- http://sayspy.blogspot.c

  • Running a Ruby script via the web 2011-01-27

    I have a small Ruby script that I want to run by visiting a page in a browser. This might seem like a dumb question but what's the easiest way to accomplish this? I haven't found very good documentation on how to get Ruby working with Apache so I'm o

  • rubber stuck compiling ruby 2011-02-10

    for some reason whenever i try to spawn a server with rubber it gets stuck after compiling ruby-1.9.2. If I SSH into the server, I see that before it finishes compiling, almost at the very end, the rubber script disconnects the connection. ** [out ::

  • synchronize two ruby scripts on same computer 2011-02-13

    What's the best way to synchronize two ruby scripts running on the same computer? The scripts will be started as separate processes from the shell. I want the scripts to take turns running. That is, I want script A to run, send a signal to script B,

  • ruby script/server ERROR missing msvcrt-ruby191.dll 2011-03-18

    Hi i have a small problem, first of all im trying to run a ruby-on-rails project on the XAMP server ever time i try to run the "ruby script/server" command a messege window appears saying that im missing msvcrt-ruby191.dll and the command prompt outp

  • porting ruby scripts to arm processor 2011-03-24

    How to port ruby scripts to arm processor? --------------Solutions------------- ruby scripts are platform independent. they run over an interpreter. what you need is to port the ruby interpreter to arm and then execute your scripts on it. try search

  • Erroneous "Insecure world writable dir foo in PATH" when running ruby script 2011-04-18

    When I run a ruby script, it gives me this: [[email protected] ~] myscript . /u/nathanb/bin/myscript:173: warning: Insecure world writable dir /usr/software/test/bin in PATH, mode 043777 /u/nathanb/bin/myscript:74: warning: Insecure world writable

  • how to compile ruby? 2011-05-05

    I was wondering if there is some tool that can allow me to compile ruby code so that it runs somewhat faster. For example, I have heard that there is a tool for python called pyc that allows you to compile the code, so that it runs 10 times faster. -

  • How to run ruby script as a task from ant build? 2011-07-28

    I have an exiting ant build that is called via ant -lib lib -f test_build.xml I wanted to add one more <target> section to be run after the existing one finishes. I did some research and found ant manual for exec and even a question here on SO.

  • why their is difference in output of ruby script? 2011-08-30

    I have follwing ruby scripts rubyScript.rb: require "rScript" t1 = Thread.new{LongRunningOperation(); puts "doneLong"} sleep 1 shortOperation() puts "doneShort" t1.join rScript.rb: def LongRunningOperation() puts "In LongRunningOperation method" for

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.094 (s). 11 q(s)