bugMIT/GNU Scheme - Bugs: bug #27976, CWCC is ridiculously slow


bug #27976: CWCC is ridiculously slow

Submitter:  Taylor R. Campbell <riastradh>
Submitted:  Mon 09 Nov 2009 02:16:26 AM UTC
Category:  microcode Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Suboptimal behavior
Status:  None Privacy:  Public
Assigned to:  None Originator Name: 
Open/Closed:  Open
* Mandatory Fields

Add a New Comment (Rich Markup)

  Spam posted by anonymous
Mon 09 Nov 2009 02:16:26 AM UTC, original submission:  

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.

Taylor R. Campbell <riastradh>
Group Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by riastradh (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.





    No changes have been made to this item

    Back to the top

    Powered by Savane 3.11