Re: [PATCH v4 7/8] sha1_file: do not access pack if unneeded

2017-06-26 Thread Jonathan Tan
On Sat, Jun 24, 2017 at 1:39 PM, Jeff King wrote: > On Sat, Jun 24, 2017 at 11:41:39AM -0700, Junio C Hamano wrote: > If we are open to writing anything, then I think it should follow the > same pointer-to-data pattern that the rest of the struct does. I.e., > declare the extra pack-data struct as

Re: [PATCH v4 7/8] sha1_file: do not access pack if unneeded

2017-06-24 Thread Jeff King
On Sat, Jun 24, 2017 at 11:41:39AM -0700, Junio C Hamano wrote: > > The other nice thing about whence_only is that it flips the logic. So > > any existing callers which depend on filling the union automatically > > will not be affected (though I would be surprised if there are any such > > callers

Re: [PATCH v4 7/8] sha1_file: do not access pack if unneeded

2017-06-24 Thread Junio C Hamano
Jeff King writes: > On Wed, Jun 21, 2017 at 11:15:01AM -0700, Junio C Hamano wrote: > >> > + if (!oi->typep && !oi->sizep && !oi->disk_sizep && >> > + !oi->delta_base_sha1 && !oi->typename && !oi->contentp && >> > + !oi->populate_u) { >> > + oi->whence = OI_PACKED; >> > +

Re: [PATCH v4 7/8] sha1_file: do not access pack if unneeded

2017-06-24 Thread Jeff King
On Wed, Jun 21, 2017 at 11:15:01AM -0700, Junio C Hamano wrote: > > + if (!oi->typep && !oi->sizep && !oi->disk_sizep && > > + !oi->delta_base_sha1 && !oi->typename && !oi->contentp && > > + !oi->populate_u) { > > + oi->whence = OI_PACKED; > > + return 0; > > +

Re: [PATCH v4 7/8] sha1_file: do not access pack if unneeded

2017-06-21 Thread Junio C Hamano
Jonathan Tan writes: > Add an option to struct object_info to suppress population of additional > information about a packed object if unneeded. This allows an > optimization in which sha1_object_info_extended() does not even need to > access the pack if no information besides provenance is reque

[PATCH v4 7/8] sha1_file: do not access pack if unneeded

2017-06-19 Thread Jonathan Tan
Add an option to struct object_info to suppress population of additional information about a packed object if unneeded. This allows an optimization in which sha1_object_info_extended() does not even need to access the pack if no information besides provenance is requested. A subsequent patch will m