Glasgow Haskell is very slow.  I know it needs a lot of CPU time anyway,
but when I do ps it is only using 50% of the CPU available, and frequently
less.  So I think what is happening is that it is spending half of its time
waiting for the Network Filing System to open and fstat interface files.
I think there is a better way, namely to allow interface files to be stored
in archives rather than in directories.

There are other solutions.  I can store the hi files, or everything, on
local disk, but this is tiresome for me, and I shall still spend quite a lot
of time reading things off local disk.  Or GHC could use either the
select function or threading so that it can do other things while waiting
for the result of a file operation on an interface file; however I suspect
this would be complicated to implement and might not save all that much
time.

There was a similar situation in my experience with the ML-to-Java compiler;
the earlier versions could not read or write ZIP (aka jar) archives, so all
classes read in (from the system libraries) and all classes written out
(compiled code) were put in their own file.  I was persuaded to write
a simple Zip file writer in ML and while the bit twiddling was a bit of a 
chore, it didn't actually take me much more than a day's work to do it,
as a result of which the compiler ran about twice as quickly as before.  
(Later I wrote a simple Zip file reader - which was just as easy - and when the 
SML/NJ folks get their new foreign function interface sorted out I might
do compression/decompression as well, with the help of zlib.)

Reply via email to