What strategy for random accession of records in massive FASTA file?

Paul Rubin http
Fri Jan 14 15:30:57 EST 2005


"Chris Lasher" <chris.lasher at gmail.com> writes:
> Forgive my ignorance, but what does using mmap do for the script? My
> guess is that it improves performance, but I'm not sure how. I read the
> module documentation and the module appears to be a way to read out
> information from memory (RAM maybe?).

Mmap lets you treat a disk file as an array, so you can randomly
access the bytes in the file without having to do seek operations.
Just say a[234]='x' and you've changed byte 234 of the file to the
letter x.  It works through the OS's virtual memory system and the
computer's MMU hardware, and so it has lower overhead than doing
system calls for every access.



More information about the Python-list mailing list