Re: [GSoC] Git Blog 12
- From
ZheNing Hu <adlternative@gmail.com>
- Date
- Aug 11, 2021, 03:47 UTC
- Message-ID
- <CAOLTT8S0etdnFNKuD7z5QMxWdERZ-FWimn4Sc+u+7Ra1F2WAmA@mail.gmail.com>
- In-Reply-To
- <CAOLTT8TQxz2xkQE7etDa3cgb-kRfho-WAyhfHTsK=FrYVsPN1A@mail.gmail.com>
ZheNing Hu <adlternative@gmail.com> 于2021年8月10日周二 下午10:20写道:
Show 19 quoted lines
> > Christian Couder <christian.couder@gmail.com> 于2021年8月10日周二 下午4:04写道: > > > > parse_object_buffer(), let's take a look at the result of gprof again: > > > > > > We need to call grab_sub_body_contents(), grab_person() to rescan the > > > buffer and extract the data. > > > What if we can combine these multiple scanning and parsing into one completion? > > > At least intuitively, this has an opportunity to improve performance. > > > > Yeah, but is there a way to check that we indeed scan or parse the > > same objects multiple times? This way we might get an idea about how > > much scanning and parsing we could save. > > > > I think find_subpos() called by grab_sub_body_contents() and find_wholine() > called by grab_person() are evidences that we are repeating iteratively. > But the proportion of time they occupy is too small. 0.0142% and 0.0109% >
Using such a method may reduce some unnecessary scans [1] But it can do very little optimization... 1.6%. On the other hand, our optimization should focus on the default format of `git cat-file --batch`.
My new idea is to need a fast path: when we use the default format, let us directly execute get_object() to avoid unnecessary traversal and checking.
Thanks, -- ZheNing Hu
[1]: https://github.com/adlternative/git/commit/7d274971d2b5e1d4e6061d1e29e4a0b2c6a10ea5