in reply to Re^3: fast lookups in files
in thread fast lookups in files
First of all, thanks a lot (and for the others who replied too)
Can you afford 108 MB of ram?
Sure!
rewrite your file in binary, packing each KV pair using 'NS'.
Well, I'm not sure if I did it right:
perl -i.bak -lane 'print pack "NS",@F' dataset.txt
But when applying the binary search, I'm getting weird keys and values (i.e. keys out of range, etc...)
citromatikUpdate:Also, the resulting binary file is 127Mb (132195175), not 108. Maybe the original file has errors (?). I will check
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: fast lookups in files
by BrowserUk (Patriarch) on Feb 05, 2008 at 16:52 UTC | |
|
Re^5: fast lookups in files
by BrowserUk (Patriarch) on Feb 05, 2008 at 16:06 UTC |