Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Speeding up data lookups

by suaveant (Parson)
on Sep 19, 2005 at 19:31 UTC ( [id://493272]=note: print w/replies, xml ) Need Help??


in reply to Re: Speeding up data lookups
in thread Speeding up data lookups

The way the data is currently stored there is only ever one key... the security identifier. mmap would probably make sense, though that is only C, yes? Or is there a way to do it in perl....

If only C, then I would probably leave it as an option to look at if all Perl fails.

                - Ant
                - Some of my best work - (1 2 3)

Replies are listed 'Best First'.
Re^3: Speeding up data lookups
by sgifford (Prior) on Sep 19, 2005 at 20:48 UTC
    As graff says, using mmap from Perl is straightforward using the Mmap module, which will map the file to a Perl string. You do have to be careful how you access the data; some operations will cause Perl to make a copy of the string, which is a bit of a problem with a 1GB string. substr is pretty safe, and probably most other things as long as you're careful not to write anything to the string.

    I wrote up a sample grep implementation using mmap here: Re: anyone have some good mmap examples?

Re^3: Speeding up data lookups
by graff (Chancellor) on Sep 19, 2005 at 20:30 UTC
    MMap

    You'll probably find a few nodes at PM that discuss this module.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-04-20 02:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found