⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (854 Bytes)
Bug #15625
» classname.rb
nelhage (Nelson Elhage)
, 02/27/2019 05:35 PM
require
'benchmark'
N
=
100_000
Benchmark
.
bm
do
|
x
|
k
=
Class
.
new
x
.
report
(
'before'
)
do
N
.
times
do
k
.
name
end
end
end
module
A
;
end
module
A1
C1
=
A
C2
=
A
end
module
A2
C1
=
A1
C2
=
A1
end
module
A3
C1
=
A2
C2
=
A2
end
module
A4
C1
=
A3
C2
=
A3
end
module
A5
C1
=
A4
C2
=
A4
end
module
A6
C1
=
A5
C2
=
A5
end
module
A7
C1
=
A6
C2
=
A6
end
module
A8
C1
=
A7
C2
=
A7
end
module
A9
C1
=
A8
C2
=
A8
end
Benchmark
.
bm
do
|
x
|
k
=
Class
.
new
x
.
report
(
'a19'
)
do
N
.
times
do
k
.
name
end
end
end
module
A10
C1
=
A9
C2
=
A9
end
Benchmark
.
bm
do
|
x
|
k
=
Class
.
new
x
.
report
(
'a10'
)
do
N
.
times
do
k
.
name
end
end
end
module
A11
C1
=
A10
C2
=
A10
end
Benchmark
.
bm
do
|
x
|
k
=
Class
.
new
x
.
report
(
'a11'
)
do
N
.
times
do
k
.
name
end
end
end
« Previous
1
2
Next »
(1-1/2)
Loading...