作者ggegge (Egg)
看板EE_DSnP
标题Re: [心得] Yet another HW5 benchmark tool
时间Tue Dec 14 23:36:13 2010
虽然说现在才更新有点太晚,不过希望可以帮助到一些还没做报告
(以及之後修课的人?)
目前功能有
- 线性作图, 对数作图
- 利用 gnuplot 画出有颜色的图
- 利用 thread 跑测试,所以如果是 4-core CPU 理论上可以快四倍
Thanks stimim!
这是另一个 Hw5 的 benchmark tool
这个工具的目标是得到执行时间随着 input 大小增长的关系
因为这个 tool 是用 Ruby 写的,因此要先有 ruby interpreter
sudo apt-get install ruby (for Ubuntu users)
如果要作图需要灌 gnuplot 以及 ruby binding
sudo apt-get install gnuplot
sudo gem install gnuplot
程式码:
http://dl.dropbox.com/u/3448912/hw5bm2.rb (程式刚好100行)
USAGE:
ruby hw5bm.rb [--plot] [START] [STOP] [STEP] [prog1 prog2 ...]
ruby hw5bm.rb [--plot] --log [START] [STOP] [prog1 prog2 ...]
其中 --plot 是 optional,加上可以利用 gnuplot 作图
Linear mode example:
ruby hw5bm.rb 100 1000 100 ./adtTest.bst
=====Test case=====
[100, 200, 300, 400, 500, 600, 700, 800, 900, 1000]
=====./adtTest.bst=====
./adtTest.bst insert:
[0.01, 0.02, 0.05, 0.06, 0.06, 0.09, 0.08, 0.1, 0.1, 0.13]
./adtTest.bst it++:
[0.0, 0.01, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0]
./adtTest.bst it--:
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0]
./adtTest.bst erase:
[0.02, 0.03, 0.04, 0.04, 0.04, 0.06, 0.06, 0.04, 0.09, 0.09]
./adtTest.bst pop front:
[0.01, 0.03, 0.04, 0.04, 0.06, 0.05, 0.07, 0.09, 0.09, 0.09]
./adtTest.bst pop back:
[0.0, 0.02, 0.02, 0.02, 0.07, 0.08, 0.08, 0.08, 0.1, 0.09]
Logrithm mode example:
ruby hw5bm.rb --log 100 10000 ./adtTest.bst
=====Test case=====
[100, 200, 400, 800, 1600, 3200, 6400]
=====./adtTest.bst=====
./adtTest.bst insert:
[0.02, 0.02, 0.03, 0.1, 0.12, 0.28, 0.5]
./adtTest.bst it++:
[0.0, 0.0, 0.0, 0.0, 0.0, 0.02, 0.02]
./adtTest.bst it--:
[0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.01]
./adtTest.bst erase:
[0.0, 0.02, 0.05, 0.09, 0.17, 0.23, 0.49]
./adtTest.bst pop front:
[0.02, 0.01, 0.02, 0.05, 0.13, 0.26, 0.6]
./adtTest.bst pop back:
[0.01, 0.03, 0.04, 0.07, 0.08, 0.26, 0.5]
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.136.201.70
※ 编辑: ggegge 来自: 114.136.201.70 (12/14 23:37)
1F:推 tomap41017:推.......还没写报告>< 12/14 23:51