-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
63 lines (41 loc) · 1.68 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Luamarca: a set of silly Lua benchmarks
=======================================
The name is from Portuguese "marca de referência", "a benchmark".
See the copyright information in the file named `COPYRIGHT`.
This code is still in its embryonic phase.
More appropriate description would be added later.
WARNING: Current benchmark system code is weird. You've been warned.
Patches are welcome. ;-)
Install rock:
./make.sh
WARNING: depends on
https://github.com/lua-nucleo/lua-nucleo
https://github.com/lua-aplicado/lua-aplicado
http://w3.impa.br/~diego/software/luasocket
https://github.com/logiceditor-com/le-tools
Example:
luamarca bench/arguments.lua --iterations=2e6
luamarca bench/benchmark.lua --cases=foo
luamarca bench/benchmark.lua --interpreters='luajit2 -jv:lua5.1'
luamarca bench/benchmark.lua --output=barchart
NOTE: Always run smoke check before submitting new benchmarks:
bin/smoke.sh bench/*.lua
Benchmark file standard:
------------------------
-- Return all methods from the file's main chunk
-- Return recommended number of iterations as NUM_ITERATIONS key
(ignored in current implementation)
Example:
local bench = { }
bench.NUM_ITERATIONS = 1e6
bench.methodA = function()
-- Do something
end
bench.methodB = function()
-- Do something in another way
end
return bench
'bargraph' output mode:
-----------------------
To make bar chart from benchmark data you need a bargraph.pl tool. You can get it from here: http://www.burningcutlery.com/derek/bargraph/
$ luamarca bench/benchmark.lua --output=bargraph >barchart.data; perl bargraph.pl -png barchart.data > barchart.png