Permalink
Browse files

ruby tests

  • Loading branch information...
1 parent 74c62c4 commit fe1d46722aba36435a195fe4c736e04968bc4c06 @apenwarr committed Oct 5, 2011
Showing with 37 additions and 10 deletions.
  1. +13 −7 Makefile
  2. +8 −0 memtest.rb
  3. +10 −0 memtest2.rb
  4. +6 −3 runtests
View
@@ -9,20 +9,26 @@ compile: *.java *.cs
test: test.csv
test.csv: compile
- rm -f $@ $@.new
+ rm -f $@ test2.csv $@.new
+ ./runtests python ./memtest.py >>$@.new
./runtests java MemTest >>$@.new
./runtests java -client MemTest >>$@.new
- ./runtests python ./memtest.py >>$@.new
./runtests java -XX:+UseConcMarkSweepGC MemTest >>$@.new
- ./runtests java -client MemTest >>$@.new
- ./runtests java -client MemTest2 >>$@.new
./runtests mono MemTest.exe >>$@.new
- ./runtests mono MemTest2.exe >>$@.new
./runtests perl memtest.pl >>$@.new
- ./runtests perl memtest2.pl >>$@.new
+ ./runtests ruby1.9 ./memtest.rb >>$@.new
./runtests ./memtest >>$@.new
./runtests valgrind ./memtest >>$@.new
+
+ ./runtests python ./memtest2.py >>$@.new
+ ./runtests java MemTest2 >>$@.new
+ ./runtests java -client MemTest2 >>$@.new
+ ./runtests mono MemTest2.exe >>$@.new
+ ./runtests perl memtest2.pl >>$@.new
+ ./runtests ruby1.9 ./memtest2.rb >>$@.new
+ ./runtests ./memtest2 >>$@.new
+
mv $@.new $@
clean:
- rm -f *~ .*~ *.class test.csv *.exe memtest memtest2
+ rm -f *~ .*~ *.class *.new test*.csv *.exe memtest memtest2
View
@@ -0,0 +1,8 @@
+INNER = 10000
+LOOPS = 1*1000*1000
+
+sleep 1
+
+for i in (0..LOOPS-1)
+ a = '\0'*INNER
+end
View
@@ -0,0 +1,10 @@
+INNER = 10000
+LOOPS = 1*1000*1000
+
+sleep 1
+
+aa = {}
+for i in (0..LOOPS-1)
+ a = '\0'*INNER
+ aa[i % 1000] = a
+end
View
@@ -20,16 +20,19 @@ def main():
amounts = []
while rv is None:
out = grab(['ps', '--no-headers', '-o', 'rss', str(p.pid)])
- amount = str(int(out))
+ amount = int(out)
if amount != '0':
amounts.append(amount)
- sys.stderr.write(' %s kb\n' % amount)
+ sys.stderr.write(' %d kb\n' % amount)
time.sleep(0.1)
rv = p.poll()
end = time.time()
elapsed = '%.1f' % (end-start-START_DELAY)
sys.stderr.write('elapsed: %s\n' % elapsed)
- print ','.join([' '.join(sys.argv[1:]), elapsed, ''] + amounts)
+ print ','.join([' '.join(sys.argv[1:]),
+ elapsed,
+ str(max(amounts)),
+ ''] + [str(i) for i in amounts])
return rv
rv = main()

0 comments on commit fe1d467

Please sign in to comment.