Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion OO benchmarks
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Leopold Toetsch  
View profile  
 More options Mar 4 2004, 9:49 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Thu, 04 Mar 2004 15:36:57 +0100
Local: Thurs, Mar 4 2004 9:36 am
Subject: OO benchmarks
I've run these 2 tests below.

Results don't look really good.
- Parrot consumes ever increasing memory, so it can't even run up to 100000
- its slow (unoptimized build for now - but that doesn't matter yet)
- Parrot is leaking a vtable per new class and worse per new instance
- I'm currently trying to avoid the vtable_clone for new objects with
some success - I still have some test errors related to can or type.

Are these 2 programs somehow equivalent?

leo

$ cat o1.pl
#! perl -w
use strict;

for my $i (1 .. 100000) {
         my $o = new Foo();

}

my $o = new Foo();
print $o->[0], "\n";

package Foo;

sub new {
     my $self = ref $_[0] ? ref shift : shift;
     return bless [ 10, 20 ], $self;

}

1;

$ cat o1.pasm

     newclass P1, "Foo"
     find_global P2, "init"
     store_global "Foo", "__init", P2
     addattribute P1, ".i"
     addattribute P1, ".j"

     set I10, 0
     set I11, 20000
loop:
     find_type I1, "Foo"
     new P3, I1
     inc I10
     #sleep 0.0001
     lt I10, I11, loop

     find_type I1, "Foo"
     new P3, I1
     classoffset I0, P3, "Foo"
     getattribute P2, P3, I0
     print P2
     print "\n"
     end

.pcc_sub init:
     classoffset I0, P2, "Foo"
     new P10, .PerlInt
     set P10, 10
     setattribute P2, I0, P10
     inc I0
     new P10, .PerlInt
     set P10, 20
     setattribute P2, I0, P10
     invoke P1


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.