Version française
Home     About     Download     Resources     Contact us    
Browse thread
Performance of immediate objects
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Chris King <colanderman@g...>
Subject: Performance of immediate objects
Is there a substantial difference to the way in which

class foo (i:int) = object
 val v = i
 method bar = v
end

let mk_foo i = new foo i

and

let mk_foo (i:int) = object
 val v = i
 method bar = v
end

are compiled?  I've run a couple tests with the above and immediate
objects seem to be about 15% slower than classes.  Is this because a
new method table is created for the immediate object every time or is
that the case for classes also?

- Chris King