caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* On registering values for use in C
@ 2007-02-19 18:37 Nathaniel Gray
  2007-02-19 22:29 ` [Caml-list] " Robert Roessler
  0 siblings, 1 reply; 2+ messages in thread
From: Nathaniel Gray @ 2007-02-19 18:37 UTC (permalink / raw)
  To: OCaml

I have a question about registering values for use in C.  I've read
that registering lots of values can have a bad effect on GC
performance, but what about registering "large" values?  For example,
is registering a record with 20 fields just as bad as registering 10
records with 2 fields each?

Thanks,
-n8

-- 
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->


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

* Re: [Caml-list] On registering values for use in C
  2007-02-19 18:37 On registering values for use in C Nathaniel Gray
@ 2007-02-19 22:29 ` Robert Roessler
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Roessler @ 2007-02-19 22:29 UTC (permalink / raw)
  To: Caml-list

Nathaniel Gray wrote:
> I have a question about registering values for use in C.  I've read
> that registering lots of values can have a bad effect on GC
> performance, but what about registering "large" values?  For example,
> is registering a record with 20 fields just as bad as registering 10
> records with 2 fields each?

Having implemented "generational" GCs, I can make a generic comment on 
this (without consulting the OCaml sources): as each one of the items 
you register represents a "root" (for our purposes, a tree of items 
which *may* or *may not* not be pointed to by any other item), there 
is a certain amount of per-root overhead that gets amortized over the 
items "marked" (or copied or whatever) during a GC.  This being the 
case, it is likely that your case of "a record with 20 fields" will be 
"less bad" than your case of "10 records with 2 fields each".

Robert Roessler
roessler@rftp.com
http://www.rftp.com


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

end of thread, other threads:[~2007-02-19 22:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-19 18:37 On registering values for use in C Nathaniel Gray
2007-02-19 22:29 ` [Caml-list] " Robert Roessler

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).