in reply to Re: How to create a compact data structure?
in thread How to create a compact data structure?

My approach with such things is to use a tied hash (Berkeley DB in my case)

Can you give me an idea on the speed of using a Berkeley DB? Before even bothering to try installing it, I'd like to know by how much it would slow down.

  • Comment on Re^2: How to create a compact data structure?

Replies are listed 'Best First'.
Re^3: How to create a compact data structure?
by chromatic (Archbishop) on Dec 20, 2006 at 09:14 UTC
    Can you give me an idea on the speed of using a Berkeley DB?

    Not without profiling your application. You do take the tie hit on hash accesses, but if your working set is so large that it won't fit into memory at once, you avoid thrashing your virtual memory system.

    No matter what approach you take, you'll likely spend more time managing your data structures in an appropriate format, so you'll always pay a penalty over the naïve approach. Your goal is to amortize that over all operations to avoid a sudden slowdown at the end.