Skip to content

Instantly share code, notes, and snippets.

@chalstrick
Last active November 2, 2015 14:08
Show Gist options
  • Save chalstrick/b2f67f9ee921bb5e31bc to your computer and use it in GitHub Desktop.
Save chalstrick/b2f67f9ee921bb5e31bc to your computer and use it in GitHub Desktop.
Test JGit gitattributes support regarding performance
#!/bin/bash
set -x
# we are working against linux repo (50000 versioned files), measure time of native git status
cd ../linux
git checkout v4.2
git ls-files | wc -l
git remote -v
echo "*.txt text" >.gitattributes
echo "*.sh text" >arch/.gitattributes
time git status
# checkout latest jgit release and build it. Measure time of jgit status and which system calls we do
cd ../jgit
git fetch https://git.eclipse.org/r/jgit/jgit
git checkout v4.1.0.201509280440-r
mvn -q clean install -DskipTests
cd ../linux
time java -jar ../jgit/org.eclipse.jgit.pgm/target/jgit-cli.jar status
strace -qq -f -e trace=file -c java -jar ../jgit/org.eclipse.jgit.pgm/target/jgit-cli.jar status
# checkout ivans proposal. Measure time of jgit status and which system calls we do
cd ../jgit
git fetch https://git.eclipse.org/r/a/jgit/jgit refs/changes/45/59345/2 && git checkout FETCH_HEAD
git revert -n 8a53d7e
mvn -q clean install -DskipTests
git reset --hard
cd ../linux
time java -jar ../jgit/org.eclipse.jgit.pgm/target/jgit-cli.jar status
strace -qq -f -e trace=file -c java -jar ../jgit/org.eclipse.jgit.pgm/target/jgit-cli.jar status
# checkout 59319 Measure time of jgit status and which system calls we do
cd ../jgit
git fetch https://git.eclipse.org/r/a/jgit/jgit refs/changes/19/59319/2 && git checkout FETCH_HEAD
mvn -q clean install -DskipTests
cd ../linux
time java -jar ../jgit/org.eclipse.jgit.pgm/target/jgit-cli.jar status
strace -qq -f -e trace=file -c java -jar ../jgit/org.eclipse.jgit.pgm/target/jgit-cli.jar status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment