ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/eg/bench
(Generate patch)

Comparing Coro/eg/bench (file contents):
Revision 1.11 by root, Fri Nov 24 11:36:57 2006 UTC vs.
Revision 1.12 by root, Fri Nov 24 15:34:33 2006 UTC

6# call with two calls of transfer in a loop. 6# call with two calls of transfer in a loop.
7 7
8use Coro; 8use Coro;
9use Benchmark; 9use Benchmark;
10 10
11sub a() { } 11sub a($) { }
12 12
13$a = bless {}, main::; 13$a = bless {}, main::;
14 14
15sub b { 15sub b {
16 my ($self) = shift; 16 my ($self) = shift;
35 while() { 35 while() {
36 # some unrolling here as well.. 36 # some unrolling here as well..
37 transfer($c0, $main, 0); transfer($c0, $main, 0); 37 transfer($c0, $main, 0); transfer($c0, $main, 0);
38 transfer($c0, $main, 0); transfer($c0, $main, 0); 38 transfer($c0, $main, 0); transfer($c0, $main, 0);
39 transfer($c0, $main, 0); transfer($c0, $main, 0); 39 transfer($c0, $main, 0); transfer($c0, $main, 0);
40 transfer($c0, $main, 0); transfer($c0, $main, 0);
40 } 41 }
41} 42}
42 43
43sub doit1 { 44sub doit1 {
44 while() { 45 while() {
45 # some unrolling here as well.. 46 # some unrolling here as well..
47 transfer($c1, $main, -1); transfer($c1, $main, -1);
46 transfer($c1, $main, -1); transfer($c1, $main, -1); 48 transfer($c1, $main, -1); transfer($c1, $main, -1);
47 transfer($c1, $main, -1); transfer($c1, $main, -1); 49 transfer($c1, $main, -1); transfer($c1, $main, -1);
48 transfer($c1, $main, -1); transfer($c1, $main, -1); 50 transfer($c1, $main, -1); transfer($c1, $main, -1);
49 } 51 }
50} 52}
59 61
60transfer($main, $c0, 0); 62transfer($main, $c0, 0);
61transfer($main, $c1, -1); 63transfer($main, $c1, -1);
62 64
63timethese 1000000, { 65timethese 1000000, {
64 empty => '&a; &a', 66 function => 'a(5); a(6)',
65 method => '$a->b(5); $a->b(6)', 67 method => '$a->b(5); $a->b(6)',
66 cede => 'cede', 68 cede => 'cede',
67 transfer0=> 'transfer($main, $c0, 0)', 69 transfer0 => 'transfer($main, $c0, 0)',
68 transfer1=> 'transfer($main, $c1, -1)', 70 transfer1 => 'transfer($main, $c1, -1)',
69}; 71};
70 72

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines