Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
f1164487
Commit
f1164487
authored
Apr 27, 2015
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:mruby/mruby
parents
bdb9d4d1
ed3a2533
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
147 additions
and
5 deletions
+147
-5
.gitignore
.gitignore
+3
-0
Rakefile
Rakefile
+2
-0
benchmark/bm_ao_render.rb
benchmark/bm_ao_render.rb
+2
-2
benchmark/bm_fib.rb
benchmark/bm_fib.rb
+1
-2
benchmark/bm_so_lists.rb
benchmark/bm_so_lists.rb
+1
-1
benchmark/build_config_boxing.rb
benchmark/build_config_boxing.rb
+28
-0
benchmark/build_config_cc.rb
benchmark/build_config_cc.rb
+13
-0
benchmark/plot.gpl
benchmark/plot.gpl
+5
-0
tasks/benchmark.rake
tasks/benchmark.rake
+91
-0
tasks/mruby_build.rake
tasks/mruby_build.rake
+1
-0
No files found.
.gitignore
View file @
f1164487
...
...
@@ -2,6 +2,9 @@
*.bak
*.d
*.o
/benchmark/**/*.dat
/benchmark/*.pdf
/benchmark/*.png
*.orig
*.pdb
*.rej
...
...
Rakefile
View file @
f1164487
...
...
@@ -29,6 +29,8 @@ load "#{MRUBY_ROOT}/tasks/libmruby.rake"
load
"
#{
MRUBY_ROOT
}
/tasks/mrbgems_test.rake"
load
"
#{
MRUBY_ROOT
}
/test/mrbtest.rake"
load
"
#{
MRUBY_ROOT
}
/tasks/benchmark.rake"
##############################
# generic build targets, rules
task
:default
=>
:all
...
...
benchmark/
ao-
render.rb
→
benchmark/
bm_ao_
render.rb
View file @
f1164487
...
...
@@ -5,8 +5,8 @@
# mruby version by Hideki Miura
#
IMAGE_WIDTH
=
256
IMAGE_HEIGHT
=
256
IMAGE_WIDTH
=
64
IMAGE_HEIGHT
=
64
NSUBSAMPLES
=
2
NAO_SAMPLES
=
8
...
...
benchmark/
fib39
.rb
→
benchmark/
bm_fib
.rb
View file @
f1164487
# Fib 39
def
fib
n
return
n
if
n
<
2
fib
(
n
-
2
)
+
fib
(
n
-
1
)
end
puts
fib
(
3
9
)
puts
fib
(
3
7
)
benchmark/bm_so_lists.rb
View file @
f1164487
...
...
@@ -40,7 +40,7 @@ end
i
=
0
while
i
<
NUM
i
+=
1
i
+=
1
result
=
test_lists
()
end
...
...
benchmark/build_config_boxing.rb
0 → 100644
View file @
f1164487
MRuby
::
Build
.
new
do
|
conf
|
toolchain
:gcc
end
MRuby
::
Build
.
new
(
'no_boxing'
)
do
|
conf
|
toolchain
:gcc
conf
.
gembox
'default'
end
MRuby
::
Build
.
new
(
'word_boxing'
)
do
|
conf
|
toolchain
:gcc
conf
.
gembox
'default'
conf
.
compilers
.
each
do
|
c
|
c
.
defines
+=
%w(MRB_WORD_BOXING)
end
end
MRuby
::
Build
.
new
(
'nan_boxing'
)
do
|
conf
|
toolchain
:gcc
conf
.
gembox
'default'
conf
.
compilers
.
each
do
|
c
|
c
.
defines
+=
%w(MRB_NAN_BOXING)
end
end
benchmark/build_config_cc.rb
0 → 100644
View file @
f1164487
MRuby
::
Build
.
new
do
|
conf
|
toolchain
:gcc
end
MRuby
::
Build
.
new
(
'gcc'
)
do
|
conf
|
toolchain
:gcc
conf
.
gembox
'default'
end
MRuby
::
Build
.
new
(
'clang'
)
do
|
conf
|
toolchain
:clang
conf
.
gembox
'default'
end
benchmark/plot.gpl
0 → 100644
View file @
f1164487
set yrange [0:]
set terminal pngcairo font 'Sans, 8' lw 1 size 1400,1024
set xtics rotate by -45
set style histogram errorbars gap 2 lw 1
set style fill solid border -1
tasks/benchmark.rake
0 → 100644
View file @
f1164487
module
MRuby
BENCHMARK_REPEAT
=
4
end
$dat_files
=
[]
def
bm_files
Dir
.
glob
(
"
#{
MRUBY_ROOT
}
/benchmark/bm_*.rb"
)
end
def
build_config_name
if
ENV
[
'MRUBY_CONFIG'
]
File
.
basename
(
ENV
[
'MRUBY_CONFIG'
],
'.rb'
).
gsub
(
'build_config_'
,
''
)
else
"build"
end
end
def
plot_file
File
.
join
(
MRUBY_ROOT
,
'benchmark'
,
"
#{
build_config_name
}
.png"
)
end
def
plot
opts_file
=
"
#{
MRUBY_ROOT
}
/benchmark/plot.gpl"
opts
=
File
.
read
(
opts_file
).
each_line
.
to_a
.
map
(
&
:strip
).
join
(
';'
)
dat_files
=
$dat_files
.
group_by
{
|
f
|
File
.
dirname
(
f
).
split
(
File
::
SEPARATOR
)[
-
1
]}
opts
+=
";set output '
#{
plot_file
}
'"
opts
+=
';plot '
opts
+=
dat_files
.
keys
.
map
do
|
data_file
|
%Q['-' u 2:3:4:xtic(1) w hist title columnheader(1)]
end
.
join
(
','
)
opts
+=
';'
cmd
=
%Q{gnuplot -p -e "
#{
opts
}
"}
IO
.
popen
(
cmd
,
'w'
)
do
|
p
|
dat_files
.
each
do
|
target_name
,
bm_files
|
p
.
puts
target_name
.
gsub
(
'_'
,
'-'
)
bm_files
.
each
do
|
bm_file
|
p
.
write
File
.
read
(
bm_file
)
end
p
.
puts
"e"
end
end
end
MRuby
.
each_target
do
|
target
|
next
if
target
.
name
==
'host'
mruby_bin
=
"
#{
target
.
build_dir
}
/bin/mruby"
bm_files
.
each
do
|
bm_file
|
bm_name
=
File
.
basename
bm_file
,
".rb"
dat_dir
=
File
.
join
(
'benchmark'
,
build_config_name
,
target
.
name
)
dat_file
=
File
.
join
(
dat_dir
,
"
#{
bm_name
}
.dat"
)
$dat_files
<<
dat_file
directory
dat_dir
file
dat_file
=>
[
bm_file
,
dat_dir
,
mruby_bin
]
do
|
task
|
print
bm_name
puts
"..."
data
=
(
0
...
MRuby
::
BENCHMARK_REPEAT
).
map
do
|
n
|
str
=
%x{(time -f "%e %S %U"
#{
mruby_bin
}
#{
bm_file
}
) 2>&1 >/dev/null}
str
.
split
(
' '
).
map
(
&
:to_f
)
end
File
.
open
(
task
.
name
,
"w"
)
do
|
f
|
data
=
data
.
map
{
|
_
,
r
,
s
|
(
r
+
s
)
/
2.0
}
min
=
data
.
min
max
=
data
.
max
avg
=
data
.
inject
(
&
:
+
)
/
data
.
size
f
.
puts
"
#{
bm_name
.
gsub
(
'_'
,
'-'
)
}
#{
avg
}
#{
min
}
#{
max
}
"
end
end
end
end
file
plot_file
=>
$dat_files
do
plot
end
task
:benchmark
=>
plot_file
do
plot
end
tasks/mruby_build.rake
View file @
f1164487
...
...
@@ -8,6 +8,7 @@ module MRuby
end
def
each_target
(
&
block
)
return
to_enum
(
:each_target
)
if
block
.
nil?
@targets
.
each
do
|
key
,
target
|
target
.
instance_eval
(
&
block
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment