git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: git@vger.kernel.org
Cc: peff@peff.net, jrnieder@gmail.com, gitster@pobox.com,
	Stefan Beller <sbeller@google.com>
Subject: [RFC PATCH 0/5] Progressing with `git submodule foreach_parallel`
Date: Wed, 26 Aug 2015 17:52:41 -0700	[thread overview]
Message-ID: <1440636766-12738-1-git-send-email-sbeller@google.com> (raw)

This series applies on top of 10d0bef9981c8045b8c9aac1ca7b8761896bed0c in
the branch origin/sb/submodule-helper

The first patch is a resend of module_clone, which now contains all
memory leak fixes. 

The second patch adding the new task queue is rewritten to not
use semaphores any more, but only mutexes and condition variables
as that's what we use at other places in the code base. So it is
better to align to these places, it makes the threading pool also
easier to understand internally.
Originally there were 2 semaphores to control the queue length
(0 < queue length < number of threads), such that we don't overallocate
memory, but rather slow down the thread adding new tasks to the queue.
This has been removed and the queue may grow infinitely large.

The third patch adding `git submodule foreach_parallel` learned a
totally different behavior how to interact with the output channels
(way better for human consumption as you have early feedback and
feedback all the time, ok-ish for machine consumption, but far from
perfect).

The fourth patch rewriting index-pack was made smaller and doesn't 
rewrite the workflow any more, but only plugs in the new threading
API instead of constructing the pthreads themselves.
I started benchmarking that patch, but I seem to get only bogus results,
so I cannot tell if it still makes it 2 % slower as Jeff claimed.

The fifth patch refactors pack-objects to be *way* more understandable IMHO!
It also switches to the new threading pool, but the refactor may be
suitable also if we decide to not use the threading API there.
The reason for it being more readable is the movement of the rebalancing
into the threads themselves, which then turns out to require a lot less
of locking and communication variables.

Any feedback is welcome!
Thanks,
Stefan

Stefan Beller (5):
  submodule: implement `module_clone` as a builtin helper
  thread-utils: add a threaded task queue
  submodule: helper to run foreach in parallel
  index-pack: Use the new worker pool
  pack-objects: Use new worker pool

 builtin/index-pack.c        |  23 ++--
 builtin/pack-objects.c      | 175 ++++++++----------------
 builtin/submodule--helper.c | 318 +++++++++++++++++++++++++++++++++++++++++++-
 git-submodule.sh            |  91 ++-----------
 run-command.c               |  29 ++--
 thread-utils.c              | 227 +++++++++++++++++++++++++++++++
 thread-utils.h              |  35 +++++
 7 files changed, 677 insertions(+), 221 deletions(-)

-- 
2.5.0.264.g784836d

             reply	other threads:[~2015-08-27  0:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-27  0:52 Stefan Beller [this message]
2015-08-27  0:52 ` [PATCH 1/5] submodule: implement `module_clone` as a builtin helper Stefan Beller
2015-08-27 12:36   ` Johannes Schindelin
2015-08-27 21:57     ` Stefan Beller
2015-08-27  0:52 ` [PATCH 2/5] thread-utils: add a threaded task queue Stefan Beller
2015-08-27 12:59   ` Johannes Schindelin
2015-08-27 17:02     ` Stefan Beller
2015-08-28 15:34     ` Junio C Hamano
2015-08-27  0:52 ` [PATCH 3/5] submodule: helper to run foreach in parallel Stefan Beller
2015-08-27  0:52 ` [PATCH 4/5] index-pack: Use the new worker pool Stefan Beller
2015-08-27  0:52 ` [PATCH 5/5] pack-objects: Use " Stefan Beller

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1440636766-12738-1-git-send-email-sbeller@google.com \
    --to=sbeller@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).