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

2018-09-04 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > 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

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

2018-09-04 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > +static struct cache_entry *create_from_disk(struct index_state *istate, > struct ondisk_cache_entry *ondisk, > unsigned long *ent_size, > -

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

2018-09-02 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