Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Comment on


I've spent a couple of days thinking about this and playing with alternative solutions, but nothing comes close to being a fast as what you're doing now.

The problem of course, is that what you're doing now trades truly huge amounts of space for its speed. And so we come back to the problem of how to avoid having to either:

  • Save and load the huge lookup table quickly.
  • Or, generate it from the more compact representation more quickly.

And given the huge limits you are working with--30,000 X ranges from 0 .. 15,000,000--I don't see a solution. The presence of "inverted" ranges, in concert with the 15e6 overall range, defy all my attempts at a more compact representation. And I don't believe you'll beat Storable easily either.

In short. I have nothing to offer your original question beyond one possibility.

There is a data structure, QuadTree that might come close to achieving the performance of your current solution, but use far less memory. The problem is that writing such a solution in terms of Perl's existing data structures to achieve a pure perl solution isn't effective.

You would need to obtain a C-library and write a wrapper for it. And there is no guarantee that the solution would perform as well.

In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^7: Serializing a large object by BrowserUk
in thread Serializing a large object by daverave

and:  <code> code here </code>

  • Please read these before you post! —
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (11)
    As of 2014-12-27 17:35 GMT
    Find Nodes?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?

      Results (177 votes), past polls