git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] refs: implement reference transaction hook

From
Taylor Blau <me@ttaylorr.com>
Date
Jun 3, 2020, 16:51 UTC
Message-ID
<20200603165142.GA24049@syl.local>
In-Reply-To
<04116cc57ab37eeb50bd51a065a7c06503493bf3.1591186875.git.ps@pks.im>
Hi Patrick,
On Wed, Jun 03, 2020 at 02:27:50PM +0200, Patrick Steinhardt wrote:
Show 13 quoted lines
> In order to test the impact on the case where we don't have any
> "reference-transaction" hook installed in the repository, this commit
> introduces a new performance test for git-update-refs(1). Run against an
> empty repository, it produces the following results:
>
>   Test                                   HEAD~             HEAD
>   ------------------------------------------------------------------------------
>   1400.2: update existing reference      2.05(1.58+0.54)   2.08(1.58+0.57) +1.5%
>   1400.3: create and destroy reference   1.79(1.38+0.49)   1.82(1.39+0.51) +1.7%
>
> So the overhead is around ~1.5%. Given that git-update-refs(1) is a
> near-direct wrapper around reference transactions, there likely is no
> other command that is impacted much worse than this.

This is a serious performance regression that is worth considering. For example, a 1.5% slow-down on average in reference transactions would cause be enough for me to bisect the regression down to see what changed.

What are ways that this could be avoided? I bet that this would work quite well with Emily's work on hooks, where we could check in the configuration first whether a hook is even configured.

Could this be integrated with that? If not, could you cache the result of whether or not the hook exists, and/or implement some mechanism to say something like, for eg., "only run reference transaction hooks core.blah = 1" is true?

I haven't myself looked seriously at your patch (although I do plan on doing so, but haven't yet had time), but I think that this should be considered thoroughly before moving forward.

Thanks, Taylor

Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 9 of 26 in “refs: implement reference transaction hooks”
  1. refs: implement reference transaction hooksPatrick Steinhardt, Jun 2, 2020
  2. Junio C HamanoJun 2, 2020
  3. Patrick SteinhardtJun 3, 2020
  4. SZEDER GáborJun 7, 2020
  5. Patrick SteinhardtJun 8, 2020
  6. SZEDER GáborJun 2, 2020
  7. Patrick SteinhardtJun 3, 2020
  8. refs: implement reference transaction hookPatrick Steinhardt, Jun 3, 2020
  9. Taylor BlauJun 3, 2020
  10. Patrick SteinhardtJun 4, 2020
  11. Taylor BlauJun 15, 2020
  12. Patrick SteinhardtJun 16, 2020
  13. Han-Wen NienhuysJun 3, 2020
  14. Junio C HamanoJun 3, 2020
  15. refs: implement reference transaction hookPatrick Steinhardt, Jun 18, 2020
  16. Junio C HamanoJun 18, 2020
  17. refs: implement reference transaction hookPatrick Steinhardt, Jun 19, 2020
  18. Jeff KingOct 23, 2020
  19. Junio C HamanoOct 23, 2020
  20. Taylor BlauOct 23, 2020
  21. Taylor BlauOct 23, 2020
  22. Patrick SteinhardtOct 26, 2020
  23. Taylor BlauOct 26, 2020
  24. Jeff KingOct 27, 2020
  25. Patrick SteinhardtOct 28, 2020
  26. Taylor BlauOct 23, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.