From: Niklas Holsti <niklas.holsti@tidorum.invalid>
Subject: Re: A little trouble with very large arrays.
Date: Sat, 6 Oct 2018 12:35:21 +0300
Date: 2018-10-06T12:35:21+03:00 [thread overview]
Message-ID: <g1rdumF7o0aU1@mid.individual.net> (raw)
In-Reply-To: <871s93tw6h.fsf@jacob-sparre.dk>
On 18-10-06 09:40 , Jacob Sparre Andersen wrote:
> Niklas Holsti wrote:
>
>> If your FITS files are not much larger than your RAM, the fastest
>> approach is probably to "mmap" the file into your virtual address
>> space and then compute the address of any given image pixel with the
>> flattening method. If your FITS files are larger than your RAM, your
>> program should process the file as a stream, which may or may not be
>> practical, depending on what the program should output.
>
> Why not leave the transport between disk and RAM to the operating
> system, and use memory mapping even if the file is larger than the RAM
> of the system?
One could use mmap even for very large files, I guess, but on a 32-bit
system the virtual address space could run out. On a 64-bit system,
probably not.
This was advice based on my feeling of what would work best. If the file
is processed as a stream, the OS is likely to use read-ahead to speed
things up. If the file is mmap'ed to use the virtual-memory paging
system, I'm not sure if the OS will do read-ahead, but perhaps modern
OS's have some such adaptive optimisations even for mmap'ed files.
--
Niklas Holsti
Tidorum Ltd
niklas holsti tidorum fi
. @ .
next prev parent reply other threads:[~2018-10-06 9:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-04 21:38 A little trouble with very large arrays Shark8
2018-10-05 6:17 ` Jacob Sparre Andersen
2018-10-05 6:20 ` Niklas Holsti
2018-10-05 16:47 ` Shark8
2018-10-05 17:39 ` Niklas Holsti
2018-10-05 19:49 ` Shark8
2018-10-05 20:31 ` Dmitry A. Kazakov
2018-10-06 16:04 ` Jeffrey R. Carter
2018-10-06 18:49 ` Shark8
2018-10-06 21:40 ` Jeffrey R. Carter
2018-10-06 6:40 ` Jacob Sparre Andersen
2018-10-06 9:35 ` Niklas Holsti [this message]
2018-10-05 6:36 ` Dmitry A. Kazakov
2018-10-05 16:56 ` Shark8
2018-10-05 18:07 ` Niklas Holsti
2018-10-05 19:06 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox