[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

yarv and dbi

jm

2/2/2005 3:12:00 AM

Anyone out there tried dbi with yarv

dbi 0.0.23 seems to work ok ruby 1.9, however when the test.rb script
is modified as follows, by adding the required line,

###########################################################
$prog =<<'__EOP__'
require 'dbi'


__END__
1
__EOP__
###########################################################

this gives,

$../bin/ruby test-dbi.rb
YARVCore 0.1.0 rev: 120 (2005-01-09)
[direct threaded code] [optimize basic operation] [optimize regexp
match] [stack caching] [inline method cache]
== disasm: <ISeq:main@test-dbi.rb>======================================
local scope table (size: 1, argc: 0)

0000 putself_SC_xx_ax (
11)
0001 putstring_SC_ax_ab"dbi"
0003 send_opopt__WC___WC__Qfalse_0__WC__SC_ab_ax:require, 1, <ic>
0007 end_SC_ax_ax 2
------------------------------------------------------------------------
-----
in `initialize':
/home/jeffm/yarv//lib/ruby/site_ruby/1.9/dbi/dbi.rb:1180: BUG: unknown
node: NODE_BLOCK_PASS (SyntaxError)
from in `initialize'
from in `initialize'
from in `initialize'
from in `require'
from /home/jeffm/yarv//lib/ruby/site_ruby/1.9/dbi.rb:1
from in `require'
from test-dbi.rb:11

any ideas?

Jeff.



17 Answers

Charles Mills

2/2/2005 5:51:00 AM

0


jm wrote:
> Anyone out there tried dbi with yarv
>
> dbi 0.0.23 seems to work ok ruby 1.9, however when the test.rb script

> is modified as follows, by adding the required line,
>
> ###########################################################
> $prog =<<'__EOP__'
> require 'dbi'
>
(...)
I don't think YARV supports Kernel.require yet.

-Charlie

jm

2/2/2005 6:53:00 AM

0

Thanks. I've now verified that it doesn't work with require 'abbrev' or
require 'ipaddr', but each time it gives a slightly different error.

jeff.

On 02/02/2005, at 4:55 PM, Charles Mills wrote:

>
> jm wrote:
>> Anyone out there tried dbi with yarv
>>
>> dbi 0.0.23 seems to work ok ruby 1.9, however when the test.rb script
>
>> is modified as follows, by adding the required line,
>>
>> ###########################################################
>> $prog =<<'__EOP__'
>> require 'dbi'
>>
> (...)
> I don't think YARV supports Kernel.require yet.
>
> -Charlie
>
>



SASADA Koichi

2/2/2005 7:02:00 AM

0

jm <jeffm@ghostgun.com> wrote :
[ yarv and dbi ]
at Wed, 2 Feb 2005 12:12:08 +0900

Hi,

> Anyone out there tried dbi with yarv
>
> dbi 0.0.23 seems to work ok ruby 1.9, however when the test.rb script
> is modified as follows, by adding the required line,
...
> any ideas?

YARV supports "require", but no complete ruby specs.

(e.g. method(&Proc.new{ ... }) doesn't work on yarv)

I'll implement as soon as possible.

Thank you.
--
// SASADA Koichi at atdot dot net
//


Charles Mills

2/2/2005 9:34:00 PM

0

SASADA Koichi wrote:
> jm <jeffm@ghostgun.com> wrote :
> [ yarv and dbi ]
> at Wed, 2 Feb 2005 12:12:08 +0900
>
> Hi,
>
> > Anyone out there tried dbi with yarv
> >
> > dbi 0.0.23 seems to work ok ruby 1.9, however when the test.rb
script
> > is modified as follows, by adding the required line,
> ..
> > any ideas?
>
> YARV supports "require", but no complete ruby specs.
>
> (e.g. method(&Proc.new{ ... }) doesn't work on yarv)
>
> I'll implement as soon as possible.
>

Sounds like YARV is progressing quickly. Very impressive work.
-Charlie

jm

2/2/2005 10:08:00 PM

0


On 03/02/2005, at 8:35 AM, Charles Mills wrote:
>> YARV supports "require", but no complete ruby specs.
>>
>> (e.g. method(&Proc.new{ ... }) doesn't work on yarv)
>>
>> I'll implement as soon as possible.
>

I'll be a willing test subject.

> Sounds like YARV is progressing quickly. Very impressive work.
>

Agreed. By the looks of it it will put an end to those ruby are slow
comments (mine anyway).

Jeff.



Navindra Umanee

2/3/2005 12:32:00 AM

0

jm <jeffm@ghostgun.com> wrote:
> Agreed. By the looks of it it will put an end to those ruby are slow
> comments (mine anyway).

In what context did you find Ruby to be slow? A website of yours? Be
interested to hear your experiences.

Thanks,
Navin.


jm

2/3/2005 2:18:00 AM

0

Processing flow data from a router. The script caches user information
from a database then processes a 25-30MB flow file captured from a
router using flow-tools. This takes about 5 minutes on a 2.4GHz pentium
4 unloaded by any other process running at 98% utilisation
continuously. To put this into context each flow file is only 15
minutes worth of data and the current perl version does it in a bit
over 2 minutes. This perl version is showing it's lack of design in a
variety of ways including the nightmare of trying to add features it
was never designed to support. So this was a good opportunity to
rewrite it in ruby to make it more maintainable, etc.

While 5 minutes in within the time constraint that is on an unloaded
machine and the machine it's destined for has other processes sharing
the CPU.

Jeff.

On 03/02/2005, at 11:32 AM, Navindra Umanee wrote:

> jm <jeffm@ghostgun.com> wrote:
>> Agreed. By the looks of it it will put an end to those ruby are slow
>> comments (mine anyway).
>
> In what context did you find Ruby to be slow? A website of yours? Be
> interested to hear your experiences.
>
> Thanks,
> Navin.
>



Austin Ziegler

2/3/2005 3:42:00 PM

0

On Thu, 3 Feb 2005 11:18:18 +0900, jm <jeffm@ghostgun.com> wrote:
> Processing flow data from a router. The script caches user information
> from a database then processes a 25-30MB flow file captured from a
> router using flow-tools. This takes about 5 minutes on a 2.4GHz pentium
> 4 unloaded by any other process running at 98% utilisation
> continuously. To put this into context each flow file is only 15
> minutes worth of data and the current perl version does it in a bit
> over 2 minutes. This perl version is showing it's lack of design in a
> variety of ways including the nightmare of trying to add features it
> was never designed to support. So this was a good opportunity to
> rewrite it in ruby to make it more maintainable, etc.
>
> While 5 minutes in within the time constraint that is on an unloaded
> machine and the machine it's destined for has other processes sharing
> the CPU.

Could your script be doing things that could be improved in performance?

-austin
--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca


Michael Neumann

2/3/2005 4:08:00 PM

0

Austin Ziegler wrote:
> On Thu, 3 Feb 2005 11:18:18 +0900, jm <jeffm@ghostgun.com> wrote:
>
>>Processing flow data from a router. The script caches user information
>>from a database then processes a 25-30MB flow file captured from a
>>router using flow-tools. This takes about 5 minutes on a 2.4GHz pentium
>>4 unloaded by any other process running at 98% utilisation
>>continuously. To put this into context each flow file is only 15
>>minutes worth of data and the current perl version does it in a bit
>>over 2 minutes. This perl version is showing it's lack of design in a
>>variety of ways including the nightmare of trying to add features it
>>was never designed to support. So this was a good opportunity to
>>rewrite it in ruby to make it more maintainable, etc.
>>
>>While 5 minutes in within the time constraint that is on an unloaded
>>machine and the machine it's destined for has other processes sharing
>>the CPU.
>
>
> Could your script be doing things that could be improved in performance?

Well, I think Ruby/DBI is not the fastest. It parses (and splits) each
SQL statement, then joins it back into a string, even if you don't use
'?' parameter markers. This should be delayed and omitted if no
parameters were given. Not sure whether this is the reason for the slowness.

Regards,

Michael


Austin Ziegler

2/3/2005 5:47:00 PM

0

On Fri, 4 Feb 2005 01:08:09 +0900, Michael Neumann <mneumann@ntecs.de> wrote:
> Austin Ziegler wrote:
> > On Thu, 3 Feb 2005 11:18:18 +0900, jm <jeffm@ghostgun.com > wrote:
> >
> >>Processing flow data from a router. The script caches user information
> >>from a database then processes a 25-30MB flow file captured from a
> >>router using flow-tools. This takes about 5 minutes on a 2.4GHz pentium
> >>4 unloaded by any other process running at 98% utilisation
> >>continuously. To put this into context each flow file is only 15
> >>minutes worth of data and the current perl version does it in a bit
> >>over 2 minutes. This perl version is showing it's lack of design in a
> >>variety of ways including the nightmare of trying to add features it
> >>was never designed to support. So this was a good opportunity to
> >>rewrite it in ruby to make it more maintainable, etc.
> >>
> >>While 5 minutes in within the time constraint that is on an unloaded
> >>machine and the machine it's destined for has other processes sharing
> >>the CPU.
> >
> >
> > Could your script be doing things that could be improved in performance?
>
> Well, I think Ruby/DBI is not the fastest. It parses (and splits) each
> SQL statement, then joins it back into a string, even if you don't use
> '?' parameter markers. This should be delayed and omitted if no
> parameters were given. Not sure whether this is the reason for the slowness.
>
> Regards,
>
> Michael
>
>


--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca