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

[PATCH 0/3] git-svn and temporary file improvements

From
Marcus Griep <marcus@griep.us>
Date
Aug 11, 2008, 15:53 UTC
Message-ID
<1218470035-13864-1-git-send-email-marcus@griep.us>
In-Reply-To
<489DBB8A.2060207@griep.us>

This series of patches relates to temp file usage within git-svn and possible extensions applicable to other perl auxiliary functions.

The first patch allows for a central "registry" of temp files to be maintained. It offers both locking and non-locking constructs depending upon the user's complexity concern. The functions provided are also documented for perldoc.

The second patch changes git-svn to utilize the central registry in the first patch to help reduce the amount of temp files created and destroyed during a normal run of git-svn. The asymptotic limit on the number of temp files needed is decreased from O(n+m) to O(1) where n is the number of files imported and m is the number of file deltas. In real terms, this change does not significantly reduce the time required for an import as other concerns, such as network and disk i/o dominate over inode/MFT changes, however an incremental reduction of ~10% system time was found on large change sets, though in a large repository of small changesets, this incremental reduction reduced to approximately 3%.

The third patch modifies the way git-svn handles symlinks versus normal files imported from svn. Currently, git-svn is very inefficient in this respect, duplicating entire files solely for the sake of eliminating the first five bytes of the file if it is a symlink. This causes a large amount of unnecessary disk i/o, even when considering most of it takes place in in-memory buffers. By eliminating the unnecessary duplication for normal files, a significant 48% reduction in system time and a 33% reduction in user time was realized on large changesets. Over many commits with small changesets, other operations dominate, but an incremental 6% reduction was still noted. In addition, in both cases a 15-25% reduction in maximum resident set size was found.

Logs and results of the benchmarks along with the procedure used are available at http://blog.xpdm.us/2008/08/git-svn-and-temporary-files.html.

Marcus Griep (3):
      Git.pm: Add faculties to allow temp files to be cached
      git-svn: Make it scream by minimizing temp files
      git-svn: Reduce temp file usage when dealing with non-links
 git-svn.perl |   84 ++++++++++++++++++++--------------
 perl/Git.pm  |  145 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 192 insertions(+), 37 deletions(-)
Previous: Eric WongNext: Marcus Griep
Message 11 of 43 in “git-svn: Make it scream by minimizing temp files”
  1. git-svn: Make it scream by minimizing temp filesMarcus Griep, Aug 8, 2008
  2. Junio C HamanoAug 8, 2008
  3. Marcus GriepAug 9, 2008
  4. Eric WongAug 9, 2008
  5. Marcus GriepAug 9, 2008
  6. Eric WongAug 10, 2008
  7. Junio C HamanoAug 10, 2008
  8. Eric WongAug 10, 2008
  9. Junio C HamanoAug 10, 2008
  10. Eric WongAug 10, 2008
  11. 0/3 git-svn and temporary file improvementsMarcus Griep, Aug 11, 2008
  12. 1/3 Git.pm: Add faculties to allow temp files to be cachedMarcus Griep, Aug 11, 2008
  13. 2/3 git-svn: Make it scream by minimizing temp filesMarcus Griep, Aug 11, 2008
  14. 3/3 git-svn: Reduce temp file usage when dealing with non-linksMarcus Griep, Aug 11, 2008
  15. Eric WongAug 12, 2008
  16. Marcus GriepAug 12, 2008
  17. 3/3 git-svn: Reduce temp file usage when dealing with non-linksMarcus Griep, Aug 12, 2008
  18. 3/3 git-svn: Reduce temp file usage when dealing with non-linksMarcus Griep, Aug 12, 2008
  19. Eric WongAug 13, 2008
  20. Marcus GriepAug 13, 2008
  21. Eric WongAug 13, 2008
  22. Eric WongAug 12, 2008
  23. Marcus GriepAug 12, 2008
  24. 2/3 git-svn: Make it incrementally faster by minimizing temp filesMarcus Griep, Aug 12, 2008
  25. Eric WongAug 13, 2008
  26. Eric WongAug 12, 2008
  27. Marcus GriepAug 12, 2008
  28. 1/3 Git.pm: Add faculties to allow temp files to be cachedMarcus Griep, Aug 12, 2008
  29. Eric WongAug 13, 2008
  30. Lea WiemannAug 13, 2008
  31. Marcus GriepAug 13, 2008
  32. Marcus GriepAug 13, 2008
  33. Junio C HamanoAug 13, 2008
  34. Lea WiemannAug 13, 2008
  35. Git.pm: require Perl 5.6.1Lea Wiemann, Aug 13, 2008
  36. Eric WongAug 14, 2008
  37. Git.pm: Make File::Spec and File::Temp requirement lazyMarcus Griep, Aug 15, 2008
  38. Bryan DonlanAug 15, 2008
  39. Marcus GriepAug 15, 2008
  40. Git.pm: Make File::Spec and File::Temp requirement lazyMarcus Griep, Aug 15, 2008
  41. Miklos VajnaAug 13, 2008
  42. Junio C HamanoAug 14, 2008
  43. Marcus GriepAug 14, 2008

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.