nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: nitc: add option --run to execute after a successful compilation.
[nit.git]
/
tests
/
bench_send2.nit
diff --git
a/tests/bench_send2.nit
b/tests/bench_send2.nit
index
c1e29c6
..
6e70969
100644
(file)
--- a/
tests/bench_send2.nit
+++ b/
tests/bench_send2.nit
@@
-15,44
+15,48
@@
# limitations under the License.
redef class Object
# limitations under the License.
redef class Object
- meth foo do end
+ fun foo do end
end
class A
end
class A
- redef meth foo do end
+ redef fun foo do i += 1 end
init do end
init do end
+ var i = 0
end
class B
end
class B
-special A
- redef meth foo do end
+ super A
+ redef fun foo do end
init do end
end
class C
init do end
end
class C
-special A
+ super A
init do end
end
class D
init do end
end
class D
-special B
-special C
+ super B
+ super C
init do end
end
class E
init do end
end
class E
-special B
-special C
- redef meth foo do end
+ super B
+ super C
+ redef fun foo do end
init do end
end
class F
init do end
end
class F
-special D
-special E
- redef meth foo do end
+ super D
+ super E
+ redef fun foo do end
init do end
end
init do end
end
+var n = 10
+if args.not_empty then n = args.first.to_i
+
var nb = 60
var a = new Array[Object].with_capacity(nb)
for i in [0..(nb/6)[ do
var nb = 60
var a = new Array[Object].with_capacity(nb)
for i in [0..(nb/6)[ do
@@
-63,9
+67,12
@@
for i in [0..(nb/6)[ do
a[i*6+4] = new E
a[i*6+5] = new F
end
a[i*6+4] = new E
a[i*6+5] = new F
end
-for i in [0..1000000[ do
+for i in [0..1 << n[ do
for j in [0..nb[ do
a[j].foo
end
end
for j in [0..nb[ do
a[j].foo
end
end
+for j in [0..nb[ do
+ print a[j].as(A).i
+end