[MLton-devel] pinned large arrays

Andrew Wright akwright@acm.org
Wed, 22 May 2002 06:23:21 -0400


Henry Cejtin writes:
 > I  would  think that the cleaner solution to get what you want would be to do
 > the reads and writes from the mmap'd buffers in C code.  The only thing  that
 > this  would  require  from MLton would be at most weak pointers, so you would
 > know when you can run munmap.  This seems way cleaner, since weak objects are
 > useful  for other things as well.  The only speed hit would be that you would
 > go to C code for ?.sub and ?.update.  This doesn't seem very bad.   If  MLton

But it is precisely for MLton's optimizations, particularly
monomorphizing, that I want to use MLton, rather than some dynamically
typed language like scheme that does lots of dynamic type tests, boxes
values, etc.  I want to write operations like database join with the
*same* efficiency as C code.  Tables are sets of columns, and the
columns are homogeneous arrays of simple types like int, float.  I am
hoping for MLton to duplicate code appropriately so that
polymorphic join code will be specialized to each vector type.
Then the ?.sub and ?.update will be essentially the same as C,
except for the bounds check.  If the bounds check isn't lifted
out of the loop, it might not cost much anyway since it will hopefully
be a register compare that will not hit the memory bus.

 > did  more  fancy  optimization (lifting array accesses out of loops) that you
 > might lose a bit more, but at worst it would be a matter of  just  doing  the
 > lifting by hand.

Sounds a bit inelegant.

Andrew


_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel