Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > querying persistent ruby objects in memory

Reply
Thread Tools

querying persistent ruby objects in memory

 
 
braver
Guest
Posts: n/a
 
      05-26-2007
I have a data-mining task which loads data as a big XML tree (10+ MB)
and then reorganizes it. Even loading it with Hpricot takes 10-20
seconds. I don't want to do it for every manilupation I want to try,
especially for sequences of transformations.

Thus I wonder what's a good way to keep the huge object in memory
between the runs of querying scripts. Can Rails be used for that?
I'd rather avoid writing a client-server platform, or using it per se,
unless there's already an existing one. A vague intuition is, it
should be something like threads -- one thread parses XML and keeps it
in memory, another starts up later, somehow joins the memory space of
the first one, queries/transforms it, and ends. Then other queries/
transformations can all be run. Is there anything like it?

Cheers,
Alexy

 
Reply With Quote
 
 
 
 
Robert Klemme
Guest
Posts: n/a
 
      05-26-2007
On 26.05.2007 23:00, braver wrote:
> I have a data-mining task which loads data as a big XML tree (10+ MB)
> and then reorganizes it. Even loading it with Hpricot takes 10-20
> seconds. I don't want to do it for every manilupation I want to try,
> especially for sequences of transformations.
>
> Thus I wonder what's a good way to keep the huge object in memory
> between the runs of querying scripts. Can Rails be used for that?
> I'd rather avoid writing a client-server platform, or using it per se,
> unless there's already an existing one. A vague intuition is, it
> should be something like threads -- one thread parses XML and keeps it
> in memory, another starts up later, somehow joins the memory space of
> the first one, queries/transforms it, and ends. Then other queries/
> transformations can all be run. Is there anything like it?


I'd consider using Marshal.

Kind regards

robert
 
Reply With Quote
 
 
 
 
braver
Guest
Posts: n/a
 
      05-26-2007
On May 26, 2:24 pm, Robert Klemme <shortcut...@googlemail.com> wrote:
> I'd consider using Marshal.


That's just plain serialization, isn't it? I've seen that and
Madelaine; but my wish is to keep the objects in memory without the
need to dump/reload it, however fast. (That would be a last resort.)

The question is, can we keep an object in memory in one thread, and
explore/change it from another? In the worst case, we can probably
quickly dump an object into a memory region and reload it back via
Marshal -- I guess a crude solution is forming here, using shared
memory or RAM disk -- have to see what's there for macs... But still
I wonder what folks think in terms of all kinds of RAM persistence in
ruby solutions.

Cheers,
Alexy

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Persistent field and Persistent properties - difference gk Java 7 10-12-2010 09:43 PM
Persistent Objects with Ruby - simple beginning Casimir Pohjanraito Ruby 2 12-16-2008 09:24 PM
Memory implications for persistent Proc objects Farrel Lifson Ruby 1 11-09-2008 08:09 AM
Persistent objects Paul Rubin Python 16 12-14-2004 09:50 AM
C++ and persistent objects Perry St-Germain C++ 2 11-18-2003 02:22 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57