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

Commit performance, or lack thereof

From
James Cloos <cloos@jhcloos.com>
Date
Aug 22, 2009, 23:42 UTC
Message-ID
<m3r5v39zzz.fsf@lugabout.jhcloos.org>

Starting in the kernel tree, if one edits and adds a single file and then commits it w/o specifying the file name as an argument to commit, git uses 10 or so Megs of VM and one sees performace akin to this:

,----« gtime -v git commit -m 'make oldconfig' »
| [master 53d6af1] make oldconfig
|  1 files changed, 5 insertions(+), 2 deletions(-)
| 	Command being timed: "git commit -m make oldconfig"
| 	User time (seconds): 0.26
| 	System time (seconds): 1.06
| 	Percent of CPU this job got: 2%
| 	Elapsed (wall clock) time (h:mm:ss or m:ss): 0:47.04
| 	Average shared text size (kbytes): 0
| 	Average unshared data size (kbytes): 0
| 	Average stack size (kbytes): 0
| 	Average total size (kbytes): 0
| 	Maximum resident set size (kbytes): 0
| 	Average resident set size (kbytes): 0
| 	Major (requiring I/O) page faults: 86
| 	Minor (reclaiming a frame) page faults: 4703
| 	Voluntary context switches: 4805
| 	Involuntary context switches: 274
| 	Swaps: 0
| 	File system inputs: 48384
| 	File system outputs: 5680
| 	Socket messages sent: 0
| 	Socket messages received: 0
| 	Signals delivered: 0
| 	Page size (bytes): 4096
| 	Exit status: 0
`----

OTOH, if one does specify the filename as an argument to commit, git uses almost 300 Megs of VM and the numbers look more like:

,----« gtime -v git commit -m 'make oldconfig' .config »
| [master 4db1e8b] make oldconfig
|  1 files changed, 1 insertions(+), 1 deletions(-)
| 	Command being timed: "git commit -m make oldconfig .config"
| 	User time (seconds): 1.82
| 	System time (seconds): 1.80
| 	Percent of CPU this job got: 3%
| 	Elapsed (wall clock) time (h:mm:ss or m:ss): 1:45.72
| 	Average shared text size (kbytes): 0
| 	Average unshared data size (kbytes): 0
| 	Average stack size (kbytes): 0
| 	Average total size (kbytes): 0
| 	Maximum resident set size (kbytes): 0
| 	Average resident set size (kbytes): 0
| 	Major (requiring I/O) page faults: 1609
| 	Minor (reclaiming a frame) page faults: 21363
| 	Voluntary context switches: 10707
| 	Involuntary context switches: 620
| 	Swaps: 0
| 	File system inputs: 361192
| 	File system outputs: 11296
| 	Socket messages sent: 0
| 	Socket messages received: 0
| 	Signals delivered: 0
| 	Page size (bytes): 4096
| 	Exit status: 0
`----

Git should be able to do the latter operation as efficiently as it can do the former operation.

-JimC
-- 
James Cloos <cloos@jhcloos.com>         OpenPGP: 1024D/ED7DAEA6
Next: Junio C Hamano
Message 1 of 2 in “Commit performance, or lack thereof”
  1. James CloosAug 22, 2009
  2. Junio C HamanoAug 23, 2009

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.