Re: Why does not my declaration improve the speed?
21.11.2019, 14:56, "Rainer Joswig" <joswig@lisp.de>:
> When a library is already compiled or has its own performance settings, then your settings will have no impact.
What is the best way to recompile a library with new performance settings?
Is there a way to get the performance settings used to compile a library (or just current settings)?
>
> Note that safety 0 is not a good idea in typical code.
>
> Unless you have specific performance problems in your application, it usually does not make sense to worry about speed.
>
> Regards,
>
> Rainer Joswig
>
>> Am 21.11.2019 um 12:46 schrieb Артеменко Александр <sasha@svetlyak.ru>:
>>
>> Thank you, Martin!
>>
>> Loading a separate asdf system did the job.
>>
>> Now I see, LispWorks is slower than about 2-3 times than SBCL on my test code.
>> Thank you, loading a separate asdf system did the job.
>>
>> Now I see, LispWorks is slower than about 2-3 times than SBCL on my test code.
>>
>> I tried to add compiler declarations like before ql:quickload of the system and found
>> no speed difference between:
>>
>> (declaim (optimize (debug 3) (safety 3) (speed 0)))
>>
>> and
>>
>> (declaim (optimize (debug 0) (safety 0) (speed 3)))
>>
>> Why?
>>
>> 20.11.2019, 20:10, "Martin Simmons" <martin@lispworks.com>:
>>> The most important thing is to compile your code (especially for performance
>>> testing). I suggest moving the defuns to a separate file and compile it with
>>> compile-file or with a defsystem.
>>>
>>> The actual error occurs because TIME is a macro. If you really want to test
>>> the speed of interpreted macros, then you need :keep-macros t as well as
>>> :keep-eval t.
>>>
>>> --
>>> Martin Simmons
>>> LispWorks Ltd
>>> http://www.lispworks.com/
>>>
>>>>>>>> On Wed, 20 Nov 2019 18:49:34 +0300, Артеменко Александр said:
>>>>
>>>> Hi!
>>>>
>>>> I'm trying to test LispWork's performance with such simple test:
>>>>
>>>> (in-package "CL-USER")
>>>>
>>>> (load-all-patches)
>>>>
>>>> (load "~/quicklisp/setup.lisp")
>>>>
>>>> (ql:quickload "puri")
>>>>
>>>> (defvar *level* 5)
>>>> (defvar *delivered-image-name* "/tmp/perf")
>>>>
>>>> (defun perf ()
>>>> (loop for i from 0 to 1000000
>>>> collecting (puri:parse-uri "http://www.foo.com")))
>>>>
>>>> (defun main ()
>>>> (time (perf)))
>>>>
>>>> (deliver #'main *delivered-image-name* *level* :console t :keep-eval t)
>>>>
>>>> But when I run compiled binary, I receive this error:
>>>>
>>>> Error: Undefined operator #:|<Dummy Symbol Name>| in form (#:|<Dummy Symbol Name>| (#:|<Dummy Symbol Name>|)).
>>>> 404001F510 "???"
>>>> 404001F538 "???"
>>>> 404001F580 "???"
>>>> 404001F618 "???"
>>>> 404001F670 "???"
>>>> 404001F6D0 "???"
>>>> 404001F700 "???"
>>>> 404001F740 "???"
>>>> 404001F7A0 "???"
>>>> 404001F7D0 "???"
>>>> 404001F9C8 "???"
>>>> 404001FA40 "???"
>>>> 404001FB28 "???"
>>>> 404001FBA0 "???"
>>>> 404001FBD8 "???"
>>>> Quitting
>>>>
>>>> Changing *level* to 3 helps a little bit and error becomes more meaningful:
>>>>
>>>> Error: Undefined operator TIME in form (TIME (PERF)).
>>>> 1 (continue) Try invoking TIME again.
>>>> 2 Return some values from the form (TIME (PERF)).
>>>> 3 Try invoking something other than TIME with the same arguments.
>>>> 4 Set the symbol-function of TIME to another function.
>>>> 5 Set the macro-function of TIME to another function.
>>>>
>>>> Type :b for backtrace or :c <option number> to proceed.
>>>> Type :bug-form "<subject>" for a bug report template or :? for other options.
>>>>
>>>> With *level* equal to 0 or 1 programs works as expected but slower than under SBCL about 4 times.
>>>>
>>>> I want to test it at a highest optimization level to compare with SBCL. Please, help me to fix this error.
>>>>
>>>> P.S. – I found the keyword :keep-symbols and trying to pass it like :keep-symbols '(time loop) does not help very much,
>>>> Lisp complains to some internal symbols missing:
>>>>
>>>> Error: Undefined operator SYSTEM::INTERNAL-IF in form (SYSTEM::INTERNAL-IF (OR (> I #:|to-986|)) (GO #:|end-loop-983|)).
>>>>
>>>> --
>>>> Alexander Artemenko
>>>>
>>>> _______________________________________________
>>>> Lisp Hug - the mailing list for LispWorks users
>>>> lisp-hug@lispworks.com
>>>> http://www.lispworks.com/support/lisp-hug.html
>>
>> --
>> Артеменко Александр
>> Пишу прототипы, быстро и качественно.
>> На Common Lisp и Python.
>> I tried to add compiler declarations like before ql:quickload of the system and found
>> no speed difference between:
>>
>> (declaim (optimize (debug 3) (safety 3) (speed 0)))
>>
>> and
>>
>> (declaim (optimize (debug 0) (safety 0) (speed 3)))
>>
>> Why?
>>
>> 20.11.2019, 20:10, "Martin Simmons" <martin@lispworks.com>:
>>> The most important thing is to compile your code (especially for performance
>>> testing). I suggest moving the defuns to a separate file and compile it with
>>> compile-file or with a defsystem.
>>>
>>> The actual error occurs because TIME is a macro. If you really want to test
>>> the speed of interpreted macros, then you need :keep-macros t as well as
>>> :keep-eval t.
>>>
>>> --
>>> Martin Simmons
>>> LispWorks Ltd
>>> http://www.lispworks.com/
>>>
>>>>>>>> On Wed, 20 Nov 2019 18:49:34 +0300, Артеменко Александр said:
>>>>
>>>> Hi!
>>>>
>>>> I'm trying to test LispWork's performance with such simple test:
>>>>
>>>> (in-package "CL-USER")
>>>>
>>>> (load-all-patches)
>>>>
>>>> (load "~/quicklisp/setup.lisp")
>>>>
>>>> (ql:quickload "puri")
>>>>
>>>> (defvar *level* 5)
>>>> (defvar *delivered-image-name* "/tmp/perf")
>>>>
>>>> (defun perf ()
>>>> (loop for i from 0 to 1000000
>>>> collecting (puri:parse-uri "http://www.foo.com")))
>>>>
>>>> (defun main ()
>>>> (time (perf)))
>>>>
>>>> (deliver #'main *delivered-image-name* *level* :console t :keep-eval t)
>>>>
>>>> But when I run compiled binary, I receive this error:
>>>>
>>>> Error: Undefined operator #:|<Dummy Symbol Name>| in form (#:|<Dummy Symbol Name>| (#:|<Dummy Symbol Name>|)).
>>>> 404001F510 "???"
>>>> 404001F538 "???"
>>>> 404001F580 "???"
>>>> 404001F618 "???"
>>>> 404001F670 "???"
>>>> 404001F6D0 "???"
>>>> 404001F700 "???"
>>>> 404001F740 "???"
>>>> 404001F7A0 "???"
>>>> 404001F7D0 "???"
>>>> 404001F9C8 "???"
>>>> 404001FA40 "???"
>>>> 404001FB28 "???"
>>>> 404001FBA0 "???"
>>>> 404001FBD8 "???"
>>>> Quitting
>>>>
>>>> Changing *level* to 3 helps a little bit and error becomes more meaningful:
>>>>
>>>> Error: Undefined operator TIME in form (TIME (PERF)).
>>>> 1 (continue) Try invoking TIME again.
>>>> 2 Return some values from the form (TIME (PERF)).
>>>> 3 Try invoking something other than TIME with the same arguments.
>>>> 4 Set the symbol-function of TIME to another function.
>>>> 5 Set the macro-function of TIME to another function.
>>>>
>>>> Type :b for backtrace or :c <option number> to proceed.
>>>> Type :bug-form "<subject>" for a bug report template or :? for other options.
>>>>
>>>> With *level* equal to 0 or 1 programs works as expected but slower than under SBCL about 4 times.
>>>>
>>>> I want to test it at a highest optimization level to compare with SBCL. Please, help me to fix this error.
>>>>
>>>> P.S. – I found the keyword :keep-symbols and trying to pass it like :keep-symbols '(time loop) does not help very much,
>>>> Lisp complains to some internal symbols missing:
>>>>
>>>> Error: Undefined operator SYSTEM::INTERNAL-IF in form (SYSTEM::INTERNAL-IF (OR (> I #:|to-986|)) (GO #:|end-loop-983|)).
>>>>
>>>> --
>>>> Alexander Artemenko
>>>>
>>>> _______________________________________________
>>>> Lisp Hug - the mailing list for LispWorks users
>>>> lisp-hug@lispworks.com
>>>> http://www.lispworks.com/support/lisp-hug.html
>>
>> --
>> Alexander Artemenko
>>
>> _______________________________________________
>> Lisp Hug - the mailing list for LispWorks users
>> lisp-hug@lispworks.com
>> http://www.lispworks.com/support/lisp-hug.html
>
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html
--
Артеменко Александр
Пишу прототипы, быстро и качественно.
На Common Lisp и Python.
_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html