Re: [PATCH] read-cache.c: optimize reading index format v4

2018-09-04 Thread Duy Nguyen
On Mon, Aug 27, 2018 at 12:36:27PM -0700, Junio C Hamano wrote: > > PS. I notice that v4 does not pad to align entries at 4 byte boundary > > like v2/v3. This could cause a slight slow down on x86 and segfault on > > some other platforms. > > Care to elaborate? > > Long time ago, we used to

Re: [PATCH] read-cache.c: optimize reading index format v4

2018-08-29 Thread Junio C Hamano
Duy Nguyen writes: > Yeah I kinda hated dummy_entry too but the feeling wasn't strong > enough to move towards the index->version check. I guess I'm going to > do it now. Sounds like a plan. Thanks again for a pleasant read.

Re: [PATCH] read-cache.c: optimize reading index format v4

2018-08-28 Thread Ben Peart
On 8/28/2018 3:25 PM, Duy Nguyen wrote: On Mon, Aug 27, 2018 at 9:36 PM Junio C Hamano wrote: PS. I notice that v4 does not pad to align entries at 4 byte boundary like v2/v3. This could cause a slight slow down on x86 and segfault on some other platforms. Care to elaborate? Long time

Re: [PATCH] read-cache.c: optimize reading index format v4

2018-08-28 Thread Duy Nguyen
On Mon, Aug 27, 2018 at 9:36 PM Junio C Hamano wrote: > > PS. I notice that v4 does not pad to align entries at 4 byte boundary > > like v2/v3. This could cause a slight slow down on x86 and segfault on > > some other platforms. > > Care to elaborate? > > Long time ago, we used to mmap and read

Re: [PATCH] read-cache.c: optimize reading index format v4

2018-08-27 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > Running "test-tool read-cache 100" on webkit.git (275k files), reading > v2 only takes 4.226 seconds, while v4 takes 5.711 seconds, 35% more > time. The patch reduces read time on v4 to 4.319 seconds. Nice. > PS. I notice that v4 does not pad to align entries at

[PATCH] read-cache.c: optimize reading index format v4

2018-08-25 Thread Nguyễn Thái Ngọc Duy
Index format v4 requires some more computation to assemble a path based on a previous one. The current code is not very efficient because - it doubles memory copy, we assemble the final path in a temporary first before putting it back to a cache_entry - strbuf_remove() in