From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Alberto Bertogli <albertito@gmail.com>,
git@vger.kernel.org, gitster@pobox.com,
Johan Herland <johan@herland.net>
Subject: Re: [WIP PATCH 6/6] notes: add notes-index for a substantial speedup.
Date: Mon, 16 Jul 2007 00:33:19 +0100 (BST) [thread overview]
Message-ID: <Pine.LNX.4.64.0707160031040.14781@racer.site> (raw)
In-Reply-To: <Pine.LNX.4.64.0707160025480.14781@racer.site>
Hi,
[this explains what Patch 6/6 is all about:]
If GIT_NOTES_TIMING_TESTS is set, t3302 will output some timing data.
It will create three repositories, the first with 10 commits and a
commit note for each, the second with 100, the third with 1000.
For each repository, it times "git log" 100 times in several modes:
- with GIT_NOTES_REF set to a non-existing ref (should be equivalent to
the timings without this patch series),
- with no .git/notes-index,
- recreating .git/notes-index as a hash map _every_ time,
- creating .git/notes-index as a hash map, and using it the rest of the time,
- recreating .git/notes-index as a sorted list _every_ time, and
- creating .git/notes-index as a sorted list only the first time, and then
using it to find the notes by binary search.
Here is the output:
* expecting success: create_repo 10
* ok 1: setup 10
* expecting success: test_notes 10
diff --git a/expect b/output
* ok 2: notes work
* expecting success: time_notes 100
no-notes
0.13user 0.08system 0:00.22elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+45271minor)pagefaults 0swaps
no-cash
0.14user 0.13system 0:00.28elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+49421minor)pagefaults 0swaps
hash-cache-create
0.16user 0.24system 0:00.41elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+73111minor)pagefaults 0swaps
hash-cache
0.10user 0.08system 0:00.18elapsed 101%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+45660minor)pagefaults 0swaps
sorted-list-cache-create
0.23user 0.17system 0:00.40elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+72056minor)pagefaults 0swaps
sorted-list-cache
0.12user 0.08system 0:00.20elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+46854minor)pagefaults 0swaps
* ok 3: notes timing
* expecting success: create_repo 100
* ok 1: setup 100
* expecting success: test_notes 100
diff --git a/expect b/output
* ok 2: notes work
* expecting success: time_notes 100
no-notes
0.38user 0.18system 0:00.56elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+54386minor)pagefaults 0swaps
no-cash
1.45user 0.66system 0:02.13elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+93980minor)pagefaults 0swaps
hash-cache-create
1.56user 0.98system 0:02.56elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+132604minor)pagefaults 0swaps
hash-cache
0.38user 0.17system 0:00.56elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+54785minor)pagefaults 0swaps
sorted-list-cache-create
1.56user 0.88system 0:02.47elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+124215minor)pagefaults 0swaps
sorted-list-cache
0.44user 0.23system 0:00.68elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+64952minor)pagefaults 0swaps
* ok 3: notes timing
* expecting success: create_repo 1000
* ok 1: setup 1000
* expecting success: test_notes 1000
diff --git a/expect b/output
* ok 2: notes work
* expecting success: time_notes 100
no-notes
2.95user 1.19system 0:04.18elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+144766minor)pagefaults 0swaps
no-cash
23.05user 5.86system 0:33.06elapsed 87%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+639774minor)pagefaults 0swaps
hash-cache-create
23.86user 7.21system 0:32.67elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+710958minor)pagefaults 0swaps
hash-cache
3.16user 1.18system 0:04.35elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+145160minor)pagefaults 0swaps
sorted-list-cache-create
23.22user 7.32system 0:31.66elapsed 96%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+686007minor)pagefaults 0swaps
sorted-list-cache
3.74user 1.81system 0:05.77elapsed 96%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+241987minor)pagefaults 0swaps
* ok 3: notes timing
Results:
These timings were taken from a desktop machine with a few background
processes running, so take them with a grain of salt.
As expected, without a .git/notes-index, it scales pretty badly. Creating
.git/notes-index is slightly worse than that, but it typically happens
much less often than looking at a commit message. Therefore the work is
worth it, since the lookup _with_ .git/notes-index is in the same ball park
as no notes at all, with the hash map being better than the sorted
list lookup.
Therefore I will go with the hash map approach, when cleaning up patch 6/6.
But not tonight.
Ciao,
Dscho
next prev parent reply other threads:[~2007-07-15 23:33 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-15 23:19 [PATCH 0/6] Introduce commit notes Johannes Schindelin
2007-07-15 23:22 ` [PATCH 1/6] Rename git_one_line() to git_line_length() and export it Johannes Schindelin
2007-07-15 23:23 ` [PATCH 2/6] Introduce commit notes Johannes Schindelin
2007-07-15 23:36 ` Junio C Hamano
2007-07-15 23:52 ` Johannes Schindelin
2007-07-16 0:05 ` Junio C Hamano
2007-07-16 5:11 ` Junio C Hamano
2007-07-19 2:30 ` [REVISED PATCH " Johannes Schindelin
2007-07-19 3:28 ` Linus Torvalds
2007-07-19 5:13 ` Junio C Hamano
2007-07-19 9:34 ` Junio C Hamano
2007-07-19 9:57 ` Adam Hayek
2007-07-19 10:58 ` Andy Parkins
2007-07-19 11:10 ` Johannes Schindelin
2007-07-19 14:33 ` Andy Parkins
2007-07-19 17:42 ` Linus Torvalds
2007-07-20 0:20 ` Junio C Hamano
2007-07-20 4:59 ` Shawn O. Pearce
2007-07-19 17:20 ` Linus Torvalds
2007-07-19 9:50 ` Johannes Schindelin
2007-07-19 10:34 ` Olivier Galibert
2007-07-19 17:50 ` Linus Torvalds
2007-07-19 9:05 ` Wincent Colaiuta
2007-07-19 9:24 ` Johannes Schindelin
2007-07-19 9:54 ` Sven Verdoolaege
2007-07-15 23:23 ` [PATCH 3/6] Add git-notes Johannes Schindelin
2007-07-16 5:11 ` Junio C Hamano
2007-07-19 2:31 ` [REVISED PATCH " Johannes Schindelin
2007-07-19 2:54 ` Johannes Schindelin
2007-07-15 23:24 ` [PATCH 4/6] Add a test script for "git notes" Johannes Schindelin
2007-07-16 5:11 ` Junio C Hamano
2007-07-19 2:32 ` [REVISED PATCH " Johannes Schindelin
2007-07-15 23:24 ` [PATCH 5/6] Document git-notes Johannes Schindelin
2007-07-15 23:26 ` [WIP PATCH 6/6] notes: add notes-index for a substantial speedup Johannes Schindelin
2007-07-15 23:33 ` Johannes Schindelin [this message]
2007-07-16 6:01 ` Shawn O. Pearce
2007-07-16 16:29 ` Johannes Schindelin
2007-07-16 7:57 ` [PATCH 0/6] Introduce commit notes Andy Parkins
2007-07-16 8:11 ` Junio C Hamano
2007-07-16 16:26 ` Johannes Schindelin
2007-07-16 17:56 ` Junio C Hamano
2007-07-19 1:34 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0707160031040.14781@racer.site \
--to=johannes.schindelin@gmx.de \
--cc=albertito@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johan@herland.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).