caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Compilation speed of modules/functors
@ 2005-08-22 16:03 Jacques Carette
  2005-08-22 17:00 ` [Caml-list] " Christian Lindig
  0 siblings, 1 reply; 2+ messages in thread
From: Jacques Carette @ 2005-08-22 16:03 UTC (permalink / raw)
  To: caml-list

Are there known issues with compilation speed of heavily functorized 
code?  My code used to use a lot of records, but that was not very 
extensible, so I switched to using modules and functors.  Now the 
compilation time has gone from << 1 second to 5-6 seconds (on my slow 
laptop).  While not the end of the world, this still surprised me.  Are 
there known issues in this area?  Known pitfalls and work-arounds?

The actual codes are in MetaOCaml, but I did some experiments in pure 
Ocaml and got the same results, so it is not due to MetaOCaml (sorry, 
these are no longer available).  The curious can look at
http://www.metaocaml.org/examples/gausselim/
for record-based code and
http://www.cas.mcmaster.ca/~carette/metamonads/
for functor-based code.

Jacques


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

* Re: [Caml-list] Compilation speed of modules/functors
  2005-08-22 16:03 Compilation speed of modules/functors Jacques Carette
@ 2005-08-22 17:00 ` Christian Lindig
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Lindig @ 2005-08-22 17:00 UTC (permalink / raw)
  To: Jacques Carette; +Cc: caml-list


On Aug 22, 2005, at 6:03 PM, Jacques Carette wrote:
> Are there known issues with compilation speed of heavily functorized 
> code?

At least the Lua-ML interpreter is another example.

	http://www.cminusminus.org/rsync/dist/
	http://www.cminusminus.org/rsync/qc--/lua/
	http://www.cminusminus.org/rsync/qc--/lua/lualib.nw

The construction of the interpreter is discussed in these papers:
	
	http://www.eecs.harvard.edu/~nr/pubs/embed-abstract.html
	http://www.eecs.harvard.edu/~nr/pubs/mania-abstract.html

Module lualib.nw links together the library for the interpeter and uses 
heavily functorized code. It takes also several seconds to compile this 
otherwise small module.

-- Christian


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

end of thread, other threads:[~2005-08-22 17:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-22 16:03 Compilation speed of modules/functors Jacques Carette
2005-08-22 17:00 ` [Caml-list] " Christian Lindig

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