home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / function / 1374 < prev    next >
Encoding:
Internet Message Format  |  1992-11-15  |  1.8 KB

  1. Path: sparky!uunet!mcsun!uknet!mucs!m1!sewardj
  2. From: sewardj@cs.man.ac.uk (Julian Seward (DRL PhD))
  3. Newsgroups: comp.lang.functional
  4. Subject: Re: Is efficient backtracking feasible in functional languages?
  5. Message-ID: <SEWARDJ.92Nov13095450@r6a.cs.man.ac.uk>
  6. Date: 13 Nov 92 09:54:50 GMT
  7. References: <TMB.92Nov12122350@arolla.idiap.ch> <1992Nov12.162725.25836@cs.yale.edu>
  8.     <BxM80r.1Hu@dcs.glasgow.ac.uk>
  9. Sender: newsman@cs.man.ac.uk
  10. Organization: Department of Computer Science, University of Manchester
  11. Lines: 27
  12. In-reply-to: kh@dcs.glasgow.ac.uk's message of 12 Nov 92 18:14:49 GMT
  13.  
  14.  
  15. Kevin Hammond writes:
  16.  
  17. | The Haskell B. (and LML) implementations have (or had) some
  18. | interesting space leaks (as Dave Wakeling's profiler pointed out).
  19. | One of these was due to not "black-holing" closures when they were
  20. | entered (so retaining space if arguments to the original closure
  21. | became dead before the closure was fully evaluated).  It sounds as if
  22. | this may be the problem reported with the Haskell B implementation.
  23. | The most recent implementation has compiler flags to fix the problems
  24. | which Dave Wakeling reported, but I think they're disabled by default
  25. | (black-holing costs time, for instance, which you may not want to
  26. | spend).
  27.  
  28. I thought the 0.998.* versions of lml/hbc have blackholing
  29. *on* by default.  Anyway, you can turn it on manually
  30. by issuing the flag -fzap-redex to lml or hbc.
  31.  
  32. I suspect blackholing doesn't cost more than about 5% in performance
  33. terms, but it would be interesting for someone to quantify this.
  34. As I understand it, the Glasgow compiler maintains a stack of
  35. pointers to closures under evaluation, so the garbage collector
  36. can do the redex zapping, rather than impose that cost on the
  37. mutator.  lml/hbc unfortunately has to zap every closure as it
  38. goes along, which is more expensive.
  39.  
  40. Jules
  41.