wanted: efficiency note when UWP results in consing

Bug #556640 reported by Tobias C. Rittweiler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Low
Unassigned

Bug Description

It would be nice if SBCL emitted efficiency notes if an use of UWP
resulted in the need to cons, on appropriate policy like (SPEED 3).

Revision history for this message
Tobias C. Rittweiler (tcr) wrote :

Nikodemus said any work this would involve the areas
touched by the patches at

  http://article.gmane.org/gmane.lisp.steel-bank.devel/14645

Changed in sbcl:
status: New → Confirmed
Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

A lot less consing in UWP these days, but this does still occur:

(defun baz (x)
  (unwind-protect (quux x) (return-from baz (quux x))))

(defun quux (x) x)

(defun zot (n)
  (dotimes (i n) (baz i)))

Changed in sbcl:
importance: Undecided → Low
status: Confirmed → Triaged
Revision history for this message
Alastair Bridgewater (alastair-bridgewater) wrote :

Disassembling

(defun baz (x)
   (unwind-protect (quux x) (return-from baz (quux x))))

on 1.3.9.74-b7f16a3 x86-64 does not show a heap allocation sequence. These days we have dynamic-extent functions, dynamic-extent value-cells, and direct access to ancestor stack frames for dynamic-extent closures in lieu of value cells. Do UWPs in and of themselves still result in consing anymore? If so, then that is probably a separate bug. If not, then this bug is a non-issue.

Revision history for this message
Alastair Bridgewater (alastair-bridgewater) wrote :

Closing because dynamic-extent optimizations since this bug was opened mean that UWP in and of itself no longer requires consing, even when the cleanup function needs to close over its environment. If someone can come up with a test case showing that this is not the case, they may open a new bug report for it.

Changed in sbcl:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.