Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: array overhead

by Fletch (Bishop)
on Jan 05, 2011 at 21:43 UTC ( [id://880685]=note: print w/replies, xml ) Need Help??


in reply to array overhead

Throwing out some ideas at random:

  • Make sure that your data is properly scoped.
  • You say it's caching but do you clear unneeded data out after however long (so long as something has a reference to it things won't get garbage collected and will sit around)?
  • Maybe rather than keeping things in RAM you might use MLDBM or Berkeley_DB and cache some or all of your data to disk instead. If you're caching to avoid recomputing something computationally expensive the hit for IO may be smaller that the tradeoff is still worth it
  • Rewrite your program in C.
  • Less drastically use memcache or redis or the like (a distributed key/value store) and its (hopefully) more memory efficient representation.

Update: Hrmm you mention Tokyo Cabinet in another reply above so that probably negates at least two of my suggestions. Probably the first join suggestion or using pack/unpack are going to be the way to go. You might also see if you can get an unpack incantation that will work with your TC arrays.

The cake is a lie.
The cake is a lie.
The cake is a lie.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://880685]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2024-03-19 07:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found