FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
jruby/bench/java/bench_ruby_subclass.rb at test-latest_java8 · MSNexploder/jruby · GitHub
MSNexploder
/
jruby
Public
forked from
jruby/jruby
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
jruby
/
bench
/
java
/
bench_ruby_subclass.rb
Copy path
More file actions
More file actions
Latest commit
History
History
History
14 lines (13 loc) · 338 Bytes
Breadcrumbs
jruby
/
bench
/
java
/
bench_ruby_subclass.rb
Copy path
File metadata and controls
14 lines (13 loc) · 338 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
require
'java'
require
'benchmark'
TIMES
=
(
ARGV
[
0
]
||
5
)
.
to_i
Benchmark
.
bm
(
30
)
do
|
bm
|
TIMES
.
times
do
bm
.
report
(
"control, Object.new"
)
{
1_000_000
.
times
{
Object
.
new
}
}
bm
.
report
(
"new class < java Object"
)
do
myClass
=
Class
.
new
(
java
.
lang
.
Object
)
myClass
.
new
1_000_000
.
times
{
myClass
.
new
}
end
end
end
Back
|
FazBrowse Home
|
New Git URL