logo       

Re: Data_Make_Struct Considered Dangerous?: msg#01230

lang.ruby.general

Subject: Re: Data_Make_Struct Considered Dangerous?

Actually, at least for now, Ruby is my ideal tool. So far I have
developed codes in Ruby, they work, and they are wonderful. However,
sometimes I get my result in 1 day. Therefore, when I am able to increase
my code efficiency from 31,000 events/sec to 310,000 events/sec, I should
get my result in 2.4 hours instead.

This is the classic interface/kernel software architecture. I can have
both the interface and the kernel in Ruby, or I can have the interface in
Ruby but the kernel in C. Therefore, system specification and
configuration can be done in Ruby, but the real computations are done in
C. Another (light) example probably is the NumPy class in Python, where
the input is done in Python, but the heavy duty numerical processing is
done in C.

The most valuable lesson that I have learned is that, when transforming my
kernel from Ruby to C, I cannot just do simple translation from Ruby to C,
but instead I have to stay away from Ruby as far as possible, or in other
words, I need to design the kernel very differently, creating Ruby
objects and interfacing with Ruby only as necessary.

I keep both versions of my kernel, so that my input scripts can have

require 'my_kernel_ruby_version'

or

require 'my_kernel_c_version'

In this way, I can always compare the output results for consistency while
seeing a speed up in execution.

Regards,

Bill
==========================================================================
Paul Brannan <pbrannan@xxxxxxxxxx> wrote:
> Perhaps Ruby is not the tool you should be using.

> This sounds like a classic case of putting a square peg into a round
> hole.

> Paul




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise