Permalink
Browse files

added performance benchmark hooks (passing) [0.764503]

  • Loading branch information...
1 parent 137dcf2 commit 5b07641b6809bdddcf9455c7547b40eaa2389261 Kyle Maxwell committed Mar 27, 2009
Showing with 30 additions and 2 deletions.
  1. +6 −0 Makefile.am
  2. +6 −0 Makefile.in
  3. +16 −0 hooks/prepare-commit-msg
  4. +1 −1 test/craigs.json
  5. +1 −1 test/yelp-benchmark.rb
View
@@ -21,6 +21,12 @@ valgrind: parsley
install-all:
./bootstrap.sh && ./configure && make && make install && cd ruby && rake install && cd ../python && python setup.py install
+
+bench:
+ @echo "yelp..."; ./parsley test/yelp.let test/yelp.html > /dev/null
+ @echo "craigs-simple..."; ./parsley test/craigs-simple.let test/craigs-simple.html > /dev/null
+ @echo "yelp-home..."; ./parsley test/yelp-home.let test/yelp-home.html > /dev/null
+ @echo "craigs..."; ./parsley test/craigs.let test/craigs.html > /dev/null
check-am:
@echo "fictional..."; ./parsley test/fictional.let test/fictional.html 2>&1 | diff test/fictional.json - && echo " success."
View
@@ -722,6 +722,12 @@ valgrind: parsley
install-all:
./bootstrap.sh && ./configure && make && make install && cd ruby && rake install && cd ../python && python setup.py install
+bench:
+ @echo "yelp..."; ./parsley test/yelp.let test/yelp.html > /dev/null
+ @echo "craigs-simple..."; ./parsley test/craigs-simple.let test/craigs-simple.html > /dev/null
+ @echo "yelp-home..."; ./parsley test/yelp-home.let test/yelp-home.html > /dev/null
+ @echo "craigs..."; ./parsley test/craigs.let test/craigs.html > /dev/null
+
check-am:
@echo "fictional..."; ./parsley test/fictional.let test/fictional.html 2>&1 | diff test/fictional.json - && echo " success."
@echo "fictional-opt..."; ./parsley test/fictional-opt.let test/fictional-opt.html 2>&1 | diff test/fictional-opt.json - && echo " success."
View
@@ -0,0 +1,16 @@
+#!/usr/bin/env ruby
+#
+# I use this to track performance regressions in my commit messages. To
+# use, copy or symlink into .git/hooks.
+#
+message = File.read(ARGV[0]).strip
+require "benchmark"
+File.open(ARGV[0], "w") do |file|
+ ROOT = File.dirname(__FILE__) + "/../../"
+ system "cd #{ROOT} && make check"
+ status = $?.success? ? "passing" : "failing"
+ time = Benchmark.measure {
+ system "cd #{ROOT} && make bench && make bench && make bench"
+ }.real
+ file.printf "%s (%s) [%4f]", message, status, time
+end
Oops, something went wrong.

0 comments on commit 5b07641

Please sign in to comment.