1
0
mirror of https://github.com/git/git.git synced 2024-09-21 09:42:22 +02:00
git/templates
Alex Vandiver c87fbcf761 fsmonitor: don't bother pretty-printing JSON from watchman
This provides modest performance savings.  Benchmarking with the
following program, with and without `--no-pretty`, we find savings of
23% (0.316s -> 0.242s) in the git repository, and savings of 8% (5.24s
-> 4.86s) on a large repository with 580k files in the working copy.

    #!/usr/bin/perl

    use strict;
    use warnings;
    use IPC::Open2;
    use JSON::XS;

    my $pid = open2(\*CHLD_OUT, \*CHLD_IN, "watchman -j @ARGV")
        or die "open2() failed: $!\n" .
        "Falling back to scanning...\n";

    my $query = qq|["query", "$ENV{PWD}", {}]|;

    print CHLD_IN $query;
    close CHLD_IN;
    my $response = do {local $/; <CHLD_OUT>};

    JSON::XS->new->utf8->decode($response);

Signed-off-by: Alex Vandiver <alexmv@dropbox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-30 11:45:56 +09:00
..
.gitignore
branches-- Revert "Don't create the $GIT_DIR/branches directory on init" 2009-10-31 11:16:50 -07:00
hooks--applypatch-msg.sample
hooks--commit-msg.sample
hooks--fsmonitor-watchman.sample fsmonitor: don't bother pretty-printing JSON from watchman 2017-10-30 11:45:56 +09:00
hooks--post-update.sample
hooks--pre-applypatch.sample
hooks--pre-commit.sample
hooks--pre-push.sample
hooks--pre-rebase.sample treewide: correct several "up-to-date" to "up to date" 2017-08-23 12:17:22 -07:00
hooks--pre-receive.sample
hooks--prepare-commit-msg.sample
hooks--update.sample
info--exclude
Makefile
this--description