Permalink
Browse files

Add pieces for IBM, and also make sure to actually create seph.revisi…

…on before using it. =/
  • Loading branch information...
1 parent 7dcee45 commit f9f4a0f3133adcc8105402e6b20153c609b2c1f4 @olabini olabini committed Aug 21, 2011
Showing with 156 additions and 1 deletion.
  1. +27 −1 build.xml
  2. +129 −0 massage_benchmark_info_ibm.rb
View
@@ -256,7 +256,7 @@
<bench file="bench/bench_read_lexical.sp"/>
</target>
- <target name="ci-benchmark" depends="prepare" description="Runs all Seph benchmarks and outputs everything to a file in build">
+ <target name="ci-benchmark" depends="generate_version_data" description="Runs all Seph benchmarks and outputs everything to a file in build">
<bench-ci file="bench/bench_fact.sp" append="false"/>
<bench-ci file="bench/bench_fib.sp"/>
<bench-ci file="bench/bench_arithmetic.sp"/>
@@ -274,6 +274,24 @@
<exec executable="ruby" input="massage_benchmark_info2.rb"/>
</target>
+ <target name="ci-benchmark-ibm" depends="generate_version_data" description="Runs all Seph benchmarks and outputs everything to a file in build">
+ <bench-ci file="bench/bench_fact.sp" append="false"/>
+ <bench-ci file="bench/bench_fib.sp"/>
+ <bench-ci file="bench/bench_arithmetic.sp"/>
+ <bench-ci file="bench/bench_intrinsic_true.sp"/>
+ <bench-ci file="bench/bench_intrinsic_false.sp"/>
+ <bench-ci file="bench/bench_intrinsic_nil.sp"/>
+ <bench-ci file="bench/bench_intrinsic_if.sp"/>
+ <bench-ci file="bench/bench_create_abstraction.sp"/>
+ <bench-ci file="bench/bench_object_creation.sp"/>
+ <bench-ci file="bench/bench_read_cell.sp"/>
+ <bench-ci file="bench/bench_read_lexical.sp"/>
+
+ <copy file="${build.dir}/all_bench_results" tofile="/var/log/seph_benchmarks/ibm_all_bench_results-${seph.revision}" overwrite="true"/>
+
+ <exec executable="ruby" input="massage_benchmark_info_ibm.rb"/>
+ </target>
+
<target name="ci-massage-benchmarks" depends="prepare" description="Output information about benchmarks to a series of images">
<exec executable="ruby" input="massage_benchmark_info2.rb"/>
</target>
@@ -337,6 +355,14 @@
</scp>
</target>
+ <target name="ci-push-ibm-performance-measurements" depends="prepare">
+ <scp todir="seph-lang.org@seph-lang.org:/home/seph-lang.org/web/public/performance_ibm" keyfile="${user.home}/.ssh/id_rsa">
+ <fileset dir="${build.dir}/performance_report">
+ <include name="bench_*.xml"/>
+ </fileset>
+ </scp>
+ </target>
+
<target name="ci-dist-bin" depends="prepare">
<tar destfile="${release.dir}/seph-${VERSION_NUMBER}${VERSION_ADDITION}.tar.gz" compression="gzip">
<tarfileset mode="755" dir="." prefix="ioke">
@@ -0,0 +1,129 @@
+#!/usr/bin/env ruby
+
+require 'fileutils'
+require 'date'
+
+dir_name = "/var/log/seph_benchmarks"
+
+FileUtils.mkdir_p "build/performance_report"
+
+def read_bench_file(f, names, collated_results)
+ raw_results = Hash.new do |h, k|
+ h[k] = []
+ end
+
+ open(f) do |f|
+ f.each_line do |line|
+ name, time_taken = line.chomp.split(/\|/)
+ raw_results[name] << Float(time_taken)
+ end
+ end
+
+ missing_names = names.dup
+ raw_results.each do |name, times|
+ missing_names.delete(name)
+ collated_results[name] << times.min
+ end
+ missing_names.each do |name|
+ collated_results[name] << nil
+ end
+end
+
+groups = {}
+all_names = []
+Dir["bench/bench_*.sp"].each do |f|
+ current_bench = []
+ open(f) do |of|
+ of.each_line do |l|
+ if l =~ /^benchmark\("(.*?)",/
+ current_bench << $1
+ end
+ end
+ all_names |= current_bench
+ groups[f] = current_bench.sort
+ end
+end
+
+collated_results = Hash.new do |h, k|
+ h[k] = []
+end
+
+entries = []
+Dir["#{dir_name}/ibm_all_bench_results*"].sort.each do |f|
+ f =~ /ibm_all_bench_results-(.*?)$/
+ entries << $1
+ read_bench_file(f, all_names, collated_results)
+end
+
+index = 0
+git_info = entries.map do |rev|
+ who, _when, what = `git show -s --format=format:"%ae|%ad|%s" #{rev}`.split(/\|/)
+ res = [rev, who, _when, DateTime.parse(_when), what, index]
+ index += 1
+ res
+end.sort_by do |v|
+ v[3]
+end
+
+
+
+
+group_index = 0
+groups.keys.sort.each do |group|
+ unless groups[group].empty?
+ out_file = File.basename(group, ".sp")
+
+ File.open("build/performance_report/#{out_file}_data.xml", "w") do |data_file|
+ data_file.puts "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ data_file.puts "<chart>"
+
+ data_file.puts " <series>"
+ git_info.each_with_index do |gi, ix|
+ data_file.puts " <value xid=\"#{ix}\">#{gi[0]}</value>"
+ end
+ data_file.puts " </series>"
+
+ data_file.puts " <graphs>"
+
+ gid = 0
+ groups[group].sort.each do |bname|
+ unless collated_results[bname].compact.empty?
+ data_file.puts " <graph gid=\"#{gid+1}\" title=\"#{bname.gsub("&", "&amp;amp;").gsub(">", "&amp;gt;").gsub("<", "&amp;lt;")}\" balloon_text=\"{value} sec\">"
+ git_info.each_with_index do |gi, ix|
+ val = collated_results[bname][gi[5]]
+ data_file.puts " <value xid=\"#{ix}\" description=\" seconds\" url=\"https://github.com/seph-lang/seph/commit/#{gi[0]}\">#{val}</value>" if val
+ end
+
+ data_file.puts " </graph>"
+
+ gid += 1
+ end
+ end
+
+ data_file.puts " <graph gid=\"1\" title=\"revision\" hidden=\"true\" visible_in_legend=\"true\" color=\"#FFFFFF\" color_hover=\"#FFFFFF\" selected=\"false\">"
+ git_info.each_with_index do |gi, ix|
+ data_file.puts " <value xid=\"#{ix}\" description=\"#{gi[0]} &amp;nbsp;- &amp;nbsp;#{gi[1]}&lt;br&gt;#{gi[2]}&lt;br&gt;(click on chart for the changeset)&lt;br&gt;&lt;br&gt;#{gi[4]}\" url=\"https://github.com/seph-lang/seph/commit/#{gi[0]}\">0</value>"
+ end
+ data_file.puts " </graph>"
+
+ data_file.puts " </graphs>"
+
+ data_file.puts <<LABEL
+ <labels>
+ <label lid="0">
+ <y>40</y>
+ <width>640</width>
+ <text_size>16</text_size>
+ <align>center</align>
+ <text>
+ <![CDATA[<b>Trunk - Best microbenchmark time - #{out_file}.sp</b>]]>
+ </text>
+ </label>
+ </labels>
+</chart>
+LABEL
+
+ end
+ end
+end
+

0 comments on commit f9f4a0f

Please sign in to comment.