eRuby speed issue

[email protected]
Newsgroups gmane.comp.apache.mod-ruby
Message-ID <[email protected]>
I've recently started using mod_ruby and eRuby.

I came across this message in the list archive:
http://modruby.net/ml/archive/modruby/200303.month/750.html

I included a copy below.

In it Shugo says:
> Apache::ERubyRun is very slow, because it uses Tempfile.
> Tempfile is nesessary to use Kernel#load(filename, true).

In a subsequent message, Shugo posted a patch which boosted the speed of
ERubyRun dramatically.  The patch was not included in the archive.

The message was from March 2003.  I took a quick look at the ERubyRun
script and it looked like it still uses temp files.  Is that the case?
(I am running eRuby version 1.0.5.)

When I did some speed tests with ab (Apache benchmark), mod_ruby alone
was much faster than with eRuby.

Questions:
1) Could I get a copy of the patch?
2) Will the patch get merged into eRuby at some point?
3) Could I get a copy of Apache::FastEruby?
4) Any reason not to use them?

Thanks,
Mark Lindsay

> Date:  Fri, 14 Mar 2003 13:17:39 +0900
> From:  Shugo Maeda <[email protected]>
> Subject:  Re: Performance differences with eRuby invocation
> To:  [email protected] (modruby ML)
> Message-Id:  <[email protected]>
> In-Reply-To:  <1047598545.3048.33.camel@morticia>
> References:  <1047598545.3048.33.camel@morticia>
> X-Mail-Count: 00750
> 
> Hi,
> 
> At 13 Mar 2003 17:35:45 -0600,
> Gabriel Emerson <[email protected]> wrote:
> > I recently benchmarked mod_ruby and eRuby using siege, and found that
> > eRuby on my dual 300 ultrasparc does about 24 requests/sec, where
> > mod_ruby .rbx do closer to 450.  I can understand why the overhead of
> > reading a file, evaluating it, and parsing it should make eRuby a bit
> > slower. I should add that in my tests, eRuby is using mod_ruby in the
> > httpd.conf.
> 
> Apache::ERubyRun is very slow, because it uses Tempfile.
> Tempfile is nesessary to use Kernel#load(filename, true).
> 
> I wrote Apache::FastEruby. It doesn't use Tempfile and evaluates
> codes by Kernel#eval with TOP_LEVEL_BINDING.
> 
> I benchmarked it.
> 
> Apache::ERubyRun:	18.08 requests/sec
> Apache::FastERuby:	320.51 requests/sec
> 
> Maybe Apache::ERubyRun should be replaced by Apache::FastERuby,
> but my worry is binding....
> 
> Shugo
> 
> 
> attatchment (application/octet-stream) ignored
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.