caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Performance of immediate objects
@ 2006-07-11 14:10 Chris King
  2006-07-12  0:51 ` [Caml-list] " Jacques Garrigue
  0 siblings, 1 reply; 3+ messages in thread
From: Chris King @ 2006-07-11 14:10 UTC (permalink / raw)
  To: O'Caml Mailing List

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-07-12  4:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-11 14:10 Performance of immediate objects Chris King
2006-07-12  0:51 ` [Caml-list] " Jacques Garrigue
2006-07-12  4:08   ` Chris King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).