From: Martin C. <cra...@co...> - 2009-02-03 20:52:39
|
Thanks, Gbor. I have verified that the patch does solve the problem for fast > debug (as expected). If there are no objections I'd like that committed, I think it's the right thing to do. However, I am still unclear on the question of why this is consing so much. A simple getpid(2) wrapper does not cons. But here is before and after of a more complex task: Evaluation took: 19.800 seconds of real time 19.796991 seconds of total run time (19.301066 user, 0.495925 system) [ Run times consist of 0.649 seconds GC time, and 19.148 seconds non-GC time. ] 99.98% CPU 59,251,648,329 processor cycles 852,574,944 bytes consed [patched] 18.694 seconds of real time 18.688159 seconds of total run time (18.556179 user, 0.131980 system) [ Run times consist of 0.460 seconds GC time, and 18.229 seconds non-GC time. ] 99.97% CPU 55,938,726,639 processor cycles 467,941,168 bytes consed It seems that the dynamic-extend for the cons cell is not coming through for some/many alien calls. Martin Gbor Melis wrote on Mon, Feb 02, 2009 at 06:53:25PM +0100: > > diff --git a/src/compiler/aliencomp.lisp b/src/compiler/aliencomp.lisp > index 3635cb4..2f34fc5 100644 > --- a/src/compiler/aliencomp.lisp > +++ b/src/compiler/aliencomp.lisp > @@ -640,7 +640,7 @@ > (int-sap (get-lisp-obj-address (car x))) fp) > (return (values (car x) (cdr x))))))) > > -(deftransform alien-funcall ((function &rest args) * * :important t) > +(deftransform alien-funcall ((function &rest args) * * :node node :important t) > (let ((type (lvar-type function))) > (unless (alien-type-type-p type) > (give-up-ir1-transform "can't tell function type at compile time")) > @@ -698,7 +698,8 @@ > ;; to it later regardless of how the foreign stack looks > ;; like. > #!+:c-stack-is-control-stack > - (setf body `(invoke-with-saved-fp-and-pc (lambda () ,body))) > + (when (policy node (<= speed debug)) > + (setf body `(invoke-with-saved-fp-and-pc (lambda () ,body)))) > (/noshow "returning from DEFTRANSFORM ALIEN-FUNCALL" (params) body) > `(lambda (function ,@(params)) > ,body))))))) > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Sbcl-devel mailing list > Sbc...@li... > https://lists.sourceforge.net/lists/listinfo/sbcl-devel -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Martin Cracauer <cra...@co...> http://www.cons.org/cracauer/ FreeBSD - where you want to go, today. http://www.freebsd.org/ |