-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optional use_memmap argument to SpyFile read methods #9
Comments
Running this script indicates the following speedups using the memmap interface for various read methods:
A few notes about the script:
|
Feedback provided by ohspite: This was all done with your latest branch, in Ubuntu, and with a SSD (except Whenever I say "clear the disk cache" below, I mean I executed
I think the first few output listings below are probably not useful for Here is what I get the first time I run the program (or after clearing the cache):
And here is second time I run the program:
This is fairly similar to your output, though there are some differences where But, if I swap the order of tests by uncommenting the 1/True/False line and
And from then on (if I don't clear the cache) I get:
The main thing that I get from all of this is that, for accurate benchmarks, As a tangent, the only thing I might try to infer from those last two outputs All that to say, I added a line in
After that change (clearing the cache before every run), these are the numbers
They are (qualitatively, at least) stable for repeated executions. Sometimes In case you're interested, I also ran the script from a directory on a USB
In this case, there was a little more variation for repeated executions, so
|
Based on the timing numbers above and the likelihood of making repeat calls on each method, here are the defaults I'll use for the
|
Depending on an image file's band interleave, a memmap interface is not always faster than doing a direct read from the file. The various
read_*
methods ofSpyFile
subclasses should provide an optionaluse_memmap
argument that can be set to False to avoid using the memmap. This argument should be defaulted to True or False based on performance for each read method of each of the SpyFile subclasses.The text was updated successfully, but these errors were encountered: