git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <johannes.schindelin@gmx.de>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
	Lars Schneider <larsxschneider@gmail.com>
Subject: [PATCH v2] perf: accommodate for MacOSX
Date: Tue, 21 Jun 2016 15:53:43 +0200 (CEST)	[thread overview]
Message-ID: <fa788ff09727fc37d8e799dbf1a92e4bba4152c9.1466517188.git.johannes.schindelin@gmx.de> (raw)
In-Reply-To: <ae429d2481111f7ad1927ef22e3a691d4c99ebd7.1466254995.git.johannes.schindelin@gmx.de>

As this developer has no access to MacOSX developer setups anymore,
Travis becomes the best bet to run performance tests on that OS.

However, on MacOSX /usr/bin/time is that good old BSD executable that
no Linux user cares about, as demonstrated by the perf-lib.sh's use
of GNU-ish extensions. And by the hard-coded path.

Let's just work around this issue by using gtime on MacOSX, the
Homebrew-provided GNU implementation onto which pretty much every
MacOSX power user falls back anyway.

To help other developers use Travis to run performance tests on
MacOSX, the .travis.yml file now sports a commented-out line that
installs GNU time via Homebrew.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
Published-As: https://github.com/dscho/git/releases/tag/perf-macosx-v2
 .travis.yml        | 2 ++
 t/perf/perf-lib.sh | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
Interdiff vs v1:

 diff --git a/.travis.yml b/.travis.yml
 index 0e569bc..c2b76f9 100644
 --- a/.travis.yml
 +++ b/.travis.yml
 @@ -82,7 +82,9 @@ before_install:
        brew tap homebrew/binary --quiet
        brew_force_set_latest_binary_hash perforce
        brew_force_set_latest_binary_hash perforce-server
 -      brew install git-lfs perforce-server perforce gettext gnu-time
 +      # Uncomment this if you want to run perf tests:
 +      # brew install gnu-time
 +      brew install git-lfs perforce-server perforce gettext
        brew link --force gettext
        ;;
      esac;


diff --git a/.travis.yml b/.travis.yml
index c20ec54..c2b76f9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -82,6 +82,8 @@ before_install:
       brew tap homebrew/binary --quiet
       brew_force_set_latest_binary_hash perforce
       brew_force_set_latest_binary_hash perforce-server
+      # Uncomment this if you want to run perf tests:
+      # brew install gnu-time
       brew install git-lfs perforce-server perforce gettext
       brew link --force gettext
       ;;
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
index 18c363e..773f955 100644
--- a/t/perf/perf-lib.sh
+++ b/t/perf/perf-lib.sh
@@ -127,11 +127,15 @@ test_checkout_worktree () {
 # Performance tests should never fail.  If they do, stop immediately
 immediate=t
 
+# Perf tests require GNU time
+case "$(uname -s)" in Darwin) GTIME="${GTIME:-gtime}";; esac
+GTIME="${GTIME:-/usr/bin/time}"
+
 test_run_perf_ () {
 	test_cleanup=:
 	test_export_="test_cleanup"
 	export test_cleanup test_export_
-	/usr/bin/time -f "%E %U %S" -o test_time.$i "$SHELL" -c '
+	"$GTIME" -f "%E %U %S" -o test_time.$i "$SHELL" -c '
 . '"$TEST_DIRECTORY"/test-lib-functions.sh'
 test_export () {
 	[ $# != 0 ] || return 0
-- 
2.9.0.118.g0e1a633

base-commit: ab7797dbe95fff38d9265869ea367020046db118

  parent reply	other threads:[~2016-06-21 13:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-18 13:03 [PATCH] perf: accommodate for MacOSX Johannes Schindelin
2016-06-19 16:56 ` Lars Schneider
2016-06-20  6:45   ` Johannes Schindelin
2016-06-20 19:48     ` Junio C Hamano
2016-06-21  7:57       ` Lars Schneider
2016-06-21 11:55         ` Johannes Schindelin
2016-06-21 12:49           ` Lars Schneider
2016-06-21 13:50             ` Johannes Schindelin
2016-06-21 13:53 ` Johannes Schindelin [this message]
2016-06-21 18:03   ` [PATCH v2] " Lars Schneider
2016-06-21 18:35     ` Junio C Hamano

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=fa788ff09727fc37d8e799dbf1a92e4bba4152c9.1466517188.git.johannes.schindelin@gmx.de \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=larsxschneider@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.
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).