[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-mit-scheme] [bug #27976] CWCC is ridiculously slow

From: Taylor R. Campbell
Subject: [Bug-mit-scheme] [bug #27976] CWCC is ridiculously slow
Date: Mon, 09 Nov 2009 02:16:27 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US) AppleWebKit/525.18 (KHTML, like Gecko, Safari/525.20) OmniWeb/v622.


                 Summary: CWCC is ridiculously slow
                 Project: MIT/GNU Scheme
            Submitted by: riastradh
            Submitted on: Mon 09 Nov 2009 02:16:26 GMT
                Category: microcode
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Suboptimal behavior
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any



Although we use basically the same strategy for CWCC as Scheme48 uses (to
reify, copy the stack into the heap, empty the stack, and push a return
address of code that refills the stack; to reflect, replace the stack by the
reified copy in the heap), MIT Scheme runs ctak twenty times slower (!) than
Scheme48.  This causes performance problems in programs that make heavy use of
control abstractions, such as inverting the control of FOR-EACH-type
procedures to yield first-class cursors.

I'm not sure what part of CWCC takes so much time.  My two hypotheses are the
state space transition algorithm (which I don't understand, and which is very
different from Scheme48's seemingly much simpler algorithm), and switching
back and forth between compiled code and the interpreter.  Empirically, I can
see that the run-time system's wrapping around the primitive (and thus perhaps
the state space transition algorithm) occupies about two thirds of the time,
since using the CWCC primitive reduces the time in ctak by that much.  But
that leaves Scheme48's CWCC (run-time system wrapping with state space
transitions at all) still six to seven times faster than MIT Scheme's
primitive CWCC.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]