4 Apr 2012 11:30
Re: Smarter recursive inlining
Philipp Marek <philipp <at> marek.priv.at>
2012-04-04 09:30:19 GMT
2012-04-04 09:30:19 GMT
Hello Nikodemus,
> Thanks for taking it out for a ride!
You're welcome, it's my problem after all!
> 2. For reasons of type-safety the compiler has to be rather
> conservative when it comes to deriving CONS types -- so it cannot
> figure out anything sensible about (FIRST REST) anyways.
here's another test case that avoids list operations:
(defun y (x &optional z)
(labels
(($ (&optional p1 p2)
(declare (type (or (integer 0 15) keyword null) p1))
(declare (type (or (integer 0 15) null) p2))
(let* ((what (and (keywordp p1) p1))
(idx (if (numberp p1) p1 p2)))
(declare (type (or (integer 0 15) null) idx))
(declare (type (or keyword null) what))
(ecase what
((:a) (1+ idx))
((:b) ($ :a 4))
((nil)
(if (zerop idx)
1
($ :a (1- idx))))))))
(declare (inline $))
(print ($ x z)) ; disable that for (disassembly 'y) tests
(print ($ 4))))
>> Oh, and BTW, a file "x.lisp" that does (load "x") gives an error
>> Â Â Â Â error opening #P"/tmp/b.lisp": Too many open files
>> at level
>> Â Â Â Â 3054: Â Â Â Â Â Â Exit debugger, returning to top level.
>> (ie. for the ~1000) file; but my hard limit is 4096. Seems to be the soft
>> limit that gets noticed here.
>
> SBCL doesn't enforce any separate soft limits, so either you have ~1k
> extra file handles open somewhere, or something funkier is going on.
Sorry, I should have quoted more of the stack - there's three frames per file.
3044: [ABORT] Abort loading file "/tmp/b.lisp".
3045: [RETRY] Retry SLIME REPL evaluation request.
3046: [*ABORT] Return to SLIME's top level.
3047: [TERMINATE-THREAD] Terminate this thread ...
That's fine, the soft limit of 1024 is used for signaling.
Regards,
Phil
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
RSS Feed