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

suboptimal behavior of fast-import in some cases with "from"

From
Mike Hommey <mh@glandium.org>
Date
Jul 6, 2015, 22:07 UTC
Message-ID
<20150706220746.GA29367@glandium.org>
Hi,

I did something "stupid" with a script using fast-import, and that made the whole process ~20% slower on Linux and 400~500% slower on Mac. The reason this happened is that the script was essentially adding a "from" to every "commit" command, even when the "from" commit is the current head of the branch.

One of the first things parse_from does is unconditionally throw away the tree for the given branch, and then the "from" tree is loaded. So when the "from" commit is the current head of the branch, that make fast-import do more work than necessary.

Even more so when the pack flush code in gfi_unpack_entry is triggered, which, on mac, is extra slow (and explains the huge slow down there).

Now, I do understand that my script is doing something stupid. So the question is whether it's worth fixing in fast-import or not. I already fixed my script anyways.

Mike
Next: Junio C Hamano
Message 1 of 9 in “suboptimal behavior of fast-import in some cases with "from"”
  1. Mike HommeyJul 6, 2015
  2. Junio C HamanoJul 6, 2015
  3. Mike HommeyJul 9, 2015
  4. Mike HommeyJul 9, 2015
  5. fast-import: Do less work when given "from" matches current branch headMike Hommey, Jul 9, 2015
  6. Junio C HamanoJul 9, 2015
  7. Mike HommeyJul 9, 2015
  8. Junio C HamanoJul 9, 2015
  9. Junio C HamanoJul 9, 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.