[cvs-nhc98] patch applied (hat): Avoid unnecessary trace info for untraced code.

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Tue Oct 10 07:12:57 EDT 2006


Fri Feb  1 11:33:49 PST 2002  olaf
  * Avoid unnecessary trace info for untraced code.
  
  Changed combinator ulazySat so that it no longer forces evaluation of the trace so that much of untraced code is actually traced.
  
  Reduces trace size substantially:
  Adjoxo from 63 MB to 41 MB; everything reachable according to hat-check.
  A trivial test program from 4 KB to 0.5 KB; nearly everything reachable according to hat-check; unreachable part needed by hat-detect.
  
  Reduces runtime for ghc; Adjoxo from 29s to 17s.
  However, increases runtime for nhc98; Adjoxo from 31s to 1m 45s.
  
  A time profile exposes the problem for nhc98. The new ulazySat uses a new IORef for every invocation. Especially the IO machinery and the unsafePerformIO calls are very expensive in nhc98.
  
  Some percentages of Adjoxo:
  >>= 5.4%; _mkIOok2 3.4%, _mkIOok3 1.6%, unsafePerformIO 5.3%, readIOArray 2.4%, writeIOArray 2.1%, newIOArray 1.9%, newIORef 1.1%, readIORef 0.5%, writeIORef 0.4%, Ix 12.2%, Array 4.6%; sum of these: 41%
  ulazySat itself 4%
  
  I'm still not sure that the new definition of ulazySat doesn't lose necessary trace part. Actually a trace should always be demanded before its value. A little modification of uLazySat however proved, that it is not always evaluated that way. uLazySat always returns the hidden parent when its trace is demanded after its normal value.

    M ./src/compiler98/Flags.hs -1 +1
    M ./src/compiler98/HatTrans.hs -10 +3
    M ./src/compiler98/TraceTrans.hs -3 +7
    M ./src/hatlib/Hat.hs -5 +29
    M ./src/hatlib/Makefile -1 +2
    M ./src/hattrans/Flags.hs -1 +1
    M ./src/hattrans/HatTrans.hs -10 +3
    M ./src/hattrans/TraceTrans.hs -3 +7


More information about the Cvs-nhc98 mailing list