[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby speed comparison

Markus Hillbrand

10/19/2003 11:58:00 AM

Hello,

I want to use ruby as an embedded scripting language within a c++ server. As
an alternative to ruby I also took a look on python. I noticed that it is
possible to precompile scripts in python and run them later without the need
to recompile the script. As I didn't find the same possibility within the
ruby C-API I'm worrying about the speed penalties if I use ruby.
So is it possible to precompile a ruby script (I don't want to have an .exe
I want to have something like a precompiled .jar oder .class from java)?
If this isn't possible the question is if ruby isn't too slow for my usage
because I plan to use the scripting language very frequently within the
program. Are there any performance benchmarks available?

Thanks in advance,
Markus

2 Answers

gabriele renzi

10/19/2003 7:58:00 PM

0

il Sun, 19 Oct 2003 20:57:58 +0900, "Markus Hillbrand"
<m_hillbrand@hotmail.com> ha scritto::

>Hello,
>
>I want to use ruby as an embedded scripting language within a c++ server. As
>an alternative to ruby I also took a look on python. I noticed that it is
>possible to precompile scripts in python and run them later without the need
>to recompile the script. As I didn't find the same possibility within the
>ruby C-API I'm worrying about the speed penalties if I use ruby.
>So is it possible to precompile a ruby script (I don't want to have an .exe
>I want to have something like a precompiled .jar oder .class from java)?

it is not possible AFAIK, it will be with the next major release (2.0
aka rite)


>If this isn't possible the question is if ruby isn't too slow for my usage
>because I plan to use the scripting language very frequently within the
>program. Are there any performance benchmarks available?

again, AFAIK ruby is slower than python in some benchamrks (i.e.
google for 'great language shootout'). It may be faster in others.
I don't think there is a *recent* and complete benchmark/comparison of
the two.

But, I don't think this would a problem for you. I don't think that
you're planning to use $the_script_language so extensive that you
could notice differences of this kind..

I think you may even take a look at lua..
(just my 2c)

Robert Klemme

10/19/2003 8:06:00 PM

0


"Markus Hillbrand" <m_hillbrand@hotmail.com> schrieb im Newsbeitrag
news:BAY1-DAV32N1AWF4Jp000001d4f@hotmail.com...
> Hello,
>
> I want to use ruby as an embedded scripting language within a c++ server.
As
> an alternative to ruby I also took a look on python. I noticed that it is
> possible to precompile scripts in python and run them later without the
need
> to recompile the script. As I didn't find the same possibility within the
> ruby C-API I'm worrying about the speed penalties if I use ruby.

Well, if you use only one instance of the interpreter, don't throw it away,
and your script requires some code, that code will be compiled only once and
stay in mem AFAIK. (correct me someone if I'm wrong). So the overhead
shouldn't be too big.

> So is it possible to precompile a ruby script (I don't want to have an
..exe
> I want to have something like a precompiled .jar oder .class from java)?
> If this isn't possible the question is if ruby isn't too slow for my usage
> because I plan to use the scripting language very frequently within the
> program.

Only testing and measuring can answer this question. It depends on the
usage of the language and the context (i.e. your server).

> Are there any performance benchmarks available?

I guess there are. The question is, whether general purpose benchmarks will
help you. When it comes to performance, measurements have the final say.

Kind regards

robert