A pure perl solution that results in an average lookup time of < 1/2 a millisecond per record.
This indexes the 30GB/160e6 record file in around 45 minutes. (10 lines):
And this loads the 2GB index into memory, uses a binary search to find the index entry, seek to locate and readline to read the record. (50 lines)
In reply to Re: Using indexing for faster lookup in large file (PP < 0.0005s/record)
by BrowserUk
in thread Using indexing for faster lookup in large file
by anli_
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |