File: benchmark.bm

package info (click to toggle)
shoop 0.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 328 kB
  • ctags: 41
  • sloc: sh: 1,138; makefile: 209; perl: 44
file content (94 lines) | stat: -rw-r--r-- 2,118 bytes parent folder | download
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/sh
DEF_PREP=". ${SHOOPSH:-/usr/share/shoop/shoop.sh}"

bmcount ${ITERATIONS:-100}

prep true
bm 1 "internal variable sets" 'FOO=1'

prep FOO=1
bm 2 "internal variable gets" 'echo $FOO'

prep true
bm 3 "internal function sets" 'foo () { echo hi; }'

prep 'foo () { echo hi; }'
bm 4 "internal function gets" 'foo'

prep $DEF_PREP
bm 5 "shoop variable sets" 'OBJECT . foo = 1'

prep $DEF_PREP
prep OBJECT . foo = 1
bm 6 "shoop variable gets" 'OBJECT . foo'

prep $DEF_PREP
bm 7 "shoop method sets" 'OBJECT . foo : ":"'

prep $DEF_PREP
prep OBJECT . foo : ":"
bm 8 "shoop method gets" 'OBJECT . foo'

prep $DEF_PREP
prep OBJECT . foo : ":"
prep OBJECT . new BAR
bm 9 "shoop 1st-stage resolver method calls" 'BAR . foo'

prep $DEF_PREP
prep OBJECT . foo  : ':'
prep OBJECT . new BAR
prep BAR . new BLAH
bm 10 "shoop 2nd-stage resolver method calls" 'BLAH . foo'

prep $DEF_PREP
prep _shoopnocache_=1
prep OBJECT . foo  : ':'
prep OBJECT . new BAR
prep BAR . new BLAH

bm 11 "shoop 2nd-stage(nocache) resolver method calls" 'BLAH . foo'

prep OBJECT . foo  : 'echo hi'
prep OBJECT . new BAR
prep OBJECT . new BLAH
prep OBJECT . new BAZ
prep BAR . new A
prep A . parent BAR BLAH OBJECT BAZ
prepsave mi

prepclear
prep $DEF_PREP
preprestore mi
bm 12 "shoop multi-inheritance resolver method calls" 'A . foo'

prep $DEF_PREP
prep _shoopnocache_=1
preprestore mi
bm 13 "shoop multi-inheritance(nocache) resolver method calls" 'A . foo'

prep $DEF_PREP
prep _shoop_introspect=1

bm 14 "shoop variable sets(with introspect)" 'OBJECT . foo = 1'

prep $DEF_PREP
prep OBJECT . foo : ":"
prep OBJECT . new FOO
prep FOO . new BAR
bm 15 "shoop method sets not dumping cache" 'BAR . foo; OBJECT . foo : ":"'

prep $DEF_PREP
prep OBJECT . foo : ":"
prep OBJECT . new FOO
prep OBJECT . new BLAH
prep FOO . new BAR
bm 16 "shoop method sets dumping cache" 'BAR . foo; BLAH . foo : ":"'

prep $DEF_PREP
prep . ${SHOOPMOD:-/usr/share/shoop/modules}/use.sh
prep OBJECT . use also_inherit
prep OBJECT . new FOO
prep FOO . new BAR
prep BAR . new BLAH
prep OBJECT . new A
bm 17 "shoop multi-inheritance setting" 'FOO . also_inherit BLAH A'