Re: [PATCH 00/20] Read `packed-refs` using mmap()

2017-09-14 Thread Michael Haggerty
On 09/14/2017 10:23 PM, Johannes Schindelin wrote: > On Wed, 13 Sep 2017, Michael Haggerty wrote: > >> * `mmap()` the whole file rather than `read()`ing it. > > On Windows, a memory-mapped file cannot be renamed. As a consequence, the > following tests fail on `pu`: > > [...] Thanks for your

Re: [PATCH 00/20] Read `packed-refs` using mmap()

2017-09-14 Thread Johannes Schindelin
Hi Michael, On Thu, 14 Sep 2017, Michael Haggerty wrote: > On 09/13/2017 07:15 PM, Michael Haggerty wrote: > > [...] > > * `mmap()` the whole file rather than `read()`ing it. > > [...] > > Apparently this doesn't work on Windows, because the `snapshot` is > keeping the `packed-refs` file open

Re: [PATCH 00/20] Read `packed-refs` using mmap()

2017-09-14 Thread Johannes Schindelin
Hi Michael, On Wed, 13 Sep 2017, Michael Haggerty wrote: > * `mmap()` the whole file rather than `read()`ing it. On Windows, a memory-mapped file cannot be renamed. As a consequence, the following tests fail on `pu`: t1400-update-ref.sh t1404-update-ref-errors.sh t1405-main-ref-store.sh

Re: [PATCH 00/20] Read `packed-refs` using mmap()

2017-09-14 Thread Michael Haggerty
On 09/13/2017 07:15 PM, Michael Haggerty wrote: > [...] > * `mmap()` the whole file rather than `read()`ing it. > [...] Apparently this doesn't work on Windows, because the `snapshot` is keeping the `packed-refs` file open too long, so the new file can't be renamed on top of it. I didn't realize

Re: [PATCH 00/20] Read `packed-refs` using mmap()

2017-09-13 Thread Junio C Hamano
Michael Haggerty writes: > Following lots of work to extract the `packed_ref_store` into a > separate module and decouple it from the `files_ref_store`, it is now > possible to fundamentally change how the `packed-refs` file is read. > > * `mmap()` the whole file rather

[PATCH 00/20] Read `packed-refs` using mmap()

2017-09-13 Thread Michael Haggerty
Previously, any time we wanted to read even a single reference from the `packed-refs` file, we parsed the whole file and stored it in an elaborate structure in memory called a `ref_cache`. Subsequent reference lookups or iterations over some or all of the references could be done by reading from