caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Memory mapped values
@ 2001-10-08 19:24 Don Syme
  2001-10-08 19:32 ` Basile STARYNKEVITCH
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Don Syme @ 2001-10-08 19:24 UTC (permalink / raw)
  To: caml-list


This is just a random idea...

Would it be possible in theory for "input_value" to work by
memory-mapping the file being read, rather than by immediately reading
the file?  The idea would be that the structured value would then only
actually be realised in physical memory as it is touched by execution
and the corresponding pages of the memory-mapped file dragged in by the
virtual memory mechanism.  (To be honest, I haven't actually checked if
this is how input_value currently works, though I'm certain it can't
be.)

This technique would certainly require some modification to the GC, and
I'm not even sure if the relocation of internal pointers in the data
structure could be made to work (do any memory mapping primitives
provide that functionality?).  But if it could work, then that could
make for one of the very best and easiest ways of persisting data
structures - easier than moving to a relational database, and directly
related to the programming model.  In addition, the layout of data
structures on disk could be then be optimized to take into account the
access pattern at runtime.  With a page-fault costing something in the
order of a million cycles these days that could be very valuable...

Cheers,
Don

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

end of thread, other threads:[~2001-10-12 14:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-08 19:24 [Caml-list] Memory mapped values Don Syme
2001-10-08 19:32 ` Basile STARYNKEVITCH
2001-10-09  7:23 ` Fabrice Le Fessant
2001-10-12 14:42 ` Xavier Leroy

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