From: Luke Diamand <luke@diamand.org>
To: git@vger.kernel.org
Cc: "SZEDER Gábor" <szeder.dev@gmail.com>,
"Romain Merland" <merlorom@yahoo.fr>,
"Miguel Torroja" <miguel.torroja@gmail.com>,
viniciusalexandre@gmail.com,
"Lars Schneider" <larsxschneider@gmail.com>,
"Lex Spoon" <lex@lexspoon.org>, "Luke Diamand" <luke@diamand.org>
Subject: [PATCHv1 0/3] git-p4: improvements to p4 "blocking"
Date: Tue, 5 Jun 2018 10:13:47 +0100 [thread overview]
Message-ID: <20180605091350.14476-1-luke@diamand.org> (raw)
This patchset improves the way that git-p4 sends requests in "blocks".
The problem comes about because the Perforce server limits the maximum
number of results it will send back (there are actually two different
limits).
This causes git-p4 failures if you ask for too much data.
In commit 96b2d54aee ("git-p4: use -m when running p4 changes",
2015-04-20), git-p4 learned to make requests in blocks, by default 512
in size.
The problem with this, however, is that it can be very slow on large
repositories - you might have millions of commits, although only a
handful actually relate to the code you are trying to clone. Each 512
block request takes a sizeable fraction of a second to complete.
There's a command-line option to increase the block size, but unless you
know about it, it won't be at all obvious that you could use this to
speed things up.
This change
~~~~~~~~~~~
The function p4CmdList() has been taught to raise an exception when it
gets an error, and in particular, to notice and report the two "too many
results" errors.
The code that does the blocking can now start out with a nice large
block size, and then reduce it if it sees an error.
Luke Diamand (3):
git-p4: raise exceptions from p4CmdList based on error from p4 server
git-p4: narrow the scope of exceptions caught when parsing an int
git-p4: auto-size the block
git-p4.py | 72 +++++++++++++++++++++++++++++++++++------
t/t9818-git-p4-block.sh | 11 +++++++
2 files changed, 73 insertions(+), 10 deletions(-)
--
2.17.0.392.gdeb1a6e9b7
next reply other threads:[~2018-06-05 9:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-05 9:13 Luke Diamand [this message]
2018-06-05 9:13 ` [PATCHv1 1/3] git-p4: raise exceptions from p4CmdList based on error from p4 server Luke Diamand
2018-06-05 9:54 ` Eric Sunshine
2018-06-05 10:56 ` Luke Diamand
2018-06-05 19:41 ` Eric Sunshine
2018-06-05 22:14 ` Luke Diamand
2018-06-08 10:06 ` Luke Diamand
2018-06-05 9:13 ` [PATCHv1 2/3] git-p4: narrow the scope of exceptions caught when parsing an int Luke Diamand
2018-06-05 9:13 ` [PATCHv1 3/3] git-p4: auto-size the block Luke Diamand
2018-06-05 10:05 ` Eric Sunshine
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=20180605091350.14476-1-luke@diamand.org \
--to=luke@diamand.org \
--cc=git@vger.kernel.org \
--cc=larsxschneider@gmail.com \
--cc=lex@lexspoon.org \
--cc=merlorom@yahoo.fr \
--cc=miguel.torroja@gmail.com \
--cc=szeder.dev@gmail.com \
--cc=viniciusalexandre@gmail.com \
/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).