Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-19 Thread David Turner
On Fri, 2016-04-15 at 17:04 -0700, Stefan Beller wrote: > > +static int try_shm(struct index_state *istate) > > +{ > > + void *new_mmap = NULL; > > + size_t old_size = istate->mmap_size; > > + ssize_t new_size; > > + const unsigned char *sha1; > > + struct stat st; > >

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-19 Thread David Turner
On Fri, 2016-04-15 at 17:04 -0700, Stefan Beller wrote: > > +static int try_shm(struct index_state *istate) > > +{ > > + void *new_mmap = NULL; > > + size_t old_size = istate->mmap_size; > > + ssize_t new_size; > > + const unsigned char *sha1; > > + struct stat st; > >

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-15 Thread Duy Nguyen
On Sat, Apr 16, 2016 at 3:21 AM, David Turner wrote: > On Fri, 2016-04-15 at 18:25 +0700, Duy Nguyen wrote: >> On Thu, Apr 14, 2016 at 1:47 AM, David Turner < >> dtur...@twopensource.com> wrote: >> > > > + fd = unix_stream_connect(socket_path); >> > > > + if (refresh_cache) { >> > > >

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-15 Thread Stefan Beller
> +static int try_shm(struct index_state *istate) > +{ > + void *new_mmap = NULL; > + size_t old_size = istate->mmap_size; > + ssize_t new_size; > + const unsigned char *sha1; > + struct stat st; > + int fd; > + > + if (!is_main_index(istate) || > +

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-15 Thread David Turner
On Fri, 2016-04-15 at 18:25 +0700, Duy Nguyen wrote: > On Thu, Apr 14, 2016 at 1:47 AM, David Turner < > dtur...@twopensource.com> wrote: > > > > + fd = unix_stream_connect(socket_path); > > > > + if (refresh_cache) { > > > > + ret = write_in_full(fd, "refresh", 8) != 8; >

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-15 Thread David Turner
On Thu, 2016-04-14 at 17:04 +0700, Duy Nguyen wrote: > On Thu, Apr 14, 2016 at 1:47 AM, David Turner < > dtur...@twopensource.com> wrote: > > On Wed, 2016-04-13 at 20:43 +0700, Duy Nguyen wrote: > > > On Wed, Apr 13, 2016 at 7:32 AM, David Turner < > > > dtur...@twopensource.com> wrote: > > > > +NO

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-15 Thread Duy Nguyen
On Thu, Apr 14, 2016 at 1:47 AM, David Turner wrote: >> > + fd = unix_stream_connect(socket_path); >> > + if (refresh_cache) { >> > + ret = write_in_full(fd, "refresh", 8) != 8; >> >> Since we've moved to unix socket and had bidirectional communication, >> it's probably a

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-14 Thread Duy Nguyen
On Fri, Apr 15, 2016 at 12:02 AM, David Turner wrote: >> > On webkit.git with index format v2, duplicating 8 times to 1.4m >> > entries and 200MB in size: >> > >> > (vanilla) 0.986986364 s: read_index_from .git/index >> > (index-helper) 0.267850279 s: read_index_from .git/index >> > >> > Inte

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-14 Thread David Turner
On Thu, 2016-04-14 at 09:56 -0700, Junio C Hamano wrote: > David Turner writes: > > > $GIT_DIR/index-helper.path is a symlink to the socket for the > > daemon > > process. The daemon reads from the socket and executes commands. > > We generally avoid using symbolic links inside $GIT_DIR (we used

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-14 Thread Junio C Hamano
David Turner writes: > $GIT_DIR/index-helper.path is a symlink to the socket for the daemon > process. The daemon reads from the socket and executes commands. We generally avoid using symbolic links inside $GIT_DIR (we used to represent the current branch by a symbolic link HEAD pointing at the

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-14 Thread Duy Nguyen
On Thu, Apr 14, 2016 at 1:47 AM, David Turner wrote: > On Wed, 2016-04-13 at 20:43 +0700, Duy Nguyen wrote: >> On Wed, Apr 13, 2016 at 7:32 AM, David Turner < >> dtur...@twopensource.com> wrote: >> > +NOTES >> > +- >> > + >> > +$GIT_DIR/index-helper.path is a symlink >> >> In multiple worktree

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-13 Thread David Turner
On Wed, 2016-04-13 at 20:43 +0700, Duy Nguyen wrote: > On Wed, Apr 13, 2016 at 7:32 AM, David Turner < > dtur...@twopensource.com> wrote: > > +NOTES > > +- > > + > > +$GIT_DIR/index-helper.path is a symlink > > In multiple worktree context, this file will be per-worktree. So we > have one daem

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-13 Thread David Turner
On Wed, 2016-04-13 at 18:00 +0100, Ramsay Jones wrote: > > On 13/04/16 01:32, David Turner wrote: > > [snip] > > > diff --git a/git-compat-util.h b/git-compat-util.h > > index c07e0c1..8b878fe 100644 > > --- a/git-compat-util.h > > +++ b/git-compat-util.h > > @@ -513,6 +513,7 @@ static inline in

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-13 Thread Ramsay Jones
On 13/04/16 01:32, David Turner wrote: [snip] > diff --git a/git-compat-util.h b/git-compat-util.h > index c07e0c1..8b878fe 100644 > --- a/git-compat-util.h > +++ b/git-compat-util.h > @@ -513,6 +513,7 @@ static inline int ends_with(const char *str, const char > *suffix) > #define PROT_READ 1

Re: [PATCH v4 03/16] index-helper: new daemon for caching index and related stuff

2016-04-13 Thread Duy Nguyen
On Wed, Apr 13, 2016 at 7:32 AM, David Turner wrote: > +NOTES > +- > + > +$GIT_DIR/index-helper.path is a symlink In multiple worktree context, this file will be per-worktree. So we have one daemon per worktree. I think that's fine. > to a directory in $TMPDIR > +containing a Unix domain soc