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

Re: [PATCH/RFC v3 0/4] Improving performance of git clean

From
Jeff King <peff@peff.net>
Date
Apr 22, 2015, 19:46 UTC
Message-ID
<20150422194601.GB27656@peff.net>
In-Reply-To
<CAMpP7NbruKC97L1ROXV0Up9Fks8FJmgB_nxTTWpSHp-8VVE+Xw@mail.gmail.com>
On Wed, Apr 22, 2015 at 09:30:20PM +0200, erik elfström wrote:
Show 13 quoted lines
> On Tue, Apr 21, 2015 at 11:24 PM, Jeff King <peff@peff.net> wrote:
> >
> > If I understand correctly, the reason that you need per-run setup is
> > that your "git clean" command actually cleans things, and you need to
> > restore the original state for each time-trial. Can you instead use "git
> > clean -n" to do a dry-run? I think what you are timing is really the
> > "figure out what to clean" step, and not the cleaning itself.
> 
> Yes, that is the problem. A dry run will spot this particular performance
> issue but maybe we lose some value as a general performance test if
> we only do "half" the clean? Admittedly we clearly lose some value in
> the current state as well due to the copying taking more time than the
> cleaning. I could go either way here.

I guess it is a matter of opinion. I think testing only the "find out what to clean" half separately is actually beneficial, because it helps us isolate any slowdown. If we want to add a test for the other half, we can, but I do not actually think it is currently that interesting (it is just calling unlink() in a loop).

So even leaving the practical matters aside, I do not think it is a bad thing to split it up. When you add in the fact that it is practically much easier to test the first half, it seems to me that testing just that is a good first step.

-Peff
Previous: erik elfströmNext: erik elfström
Message 13 of 14 in “Improving performance of git clean”
  1. 0/4 Improving performance of git cleanErik Elfström, Apr 18, 2015
  2. 1/4 setup: add gentle version of read_gitfileErik Elfström, Apr 18, 2015
  3. 2/4 t7300: add tests to document behavior of clean and nested gitErik Elfström, Apr 18, 2015
  4. 3/4 p7300: add performance tests for cleanErik Elfström, Apr 18, 2015
  5. 4/4 clean: improve performance when removing lots of directoriesErik Elfström, Apr 18, 2015
  6. Junio C HamanoApr 19, 2015
  7. erik elfströmApr 21, 2015
  8. Thomas GummererApr 20, 2015
  9. erik elfströmApr 21, 2015
  10. Junio C HamanoApr 21, 2015
  11. Jeff KingApr 21, 2015
  12. erik elfströmApr 22, 2015
  13. Jeff KingApr 22, 2015
  14. erik elfströmApr 22, 2015

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.