git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] perf: accommodate for MacOSX

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 21, 2016, 13:53 UTC
Message-ID
<fa788ff09727fc37d8e799dbf1a92e4bba4152c9.1466517188.git.johannes.schindelin@gmx.de>
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
Previous: Johannes SchindelinNext: Lars Schneider
Message 9 of 11 in “perf: accommodate for MacOSX”
  1. perf: accommodate for MacOSXJohannes Schindelin, Jun 18, 2016
  2. Lars SchneiderJun 19, 2016
  3. Johannes SchindelinJun 20, 2016
  4. Junio C HamanoJun 20, 2016
  5. Lars SchneiderJun 21, 2016
  6. Johannes SchindelinJun 21, 2016
  7. Lars SchneiderJun 21, 2016
  8. Johannes SchindelinJun 21, 2016
  9. perf: accommodate for MacOSXJohannes Schindelin, Jun 21, 2016
  10. Lars SchneiderJun 21, 2016
  11. Junio C HamanoJun 21, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.