Eval function performance

Notices and updates
Locked
ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Eval function performance

Post by ale870 »

Hi,

I'm not sure if using eval function inside a define-macro (to evaluate a lambda function ) is fast as using a list inside a define.

Can you give me some info about eval performance?

(symbols are compiled even if they are inside a list?)

Thank you.
--

Kazimir Majorinc
Posts: 388
Joined: Thu May 08, 2008 1:24 am
Location: Croatia
Contact:

Post by Kazimir Majorinc »

Check my blog, there are two posts about that. The conclusion is that in Newlisp, eval doesn't slow down evaluation significantly.

In my experience, it is not the case in CL and Scheme implementations, use of eval, and especially if evaluated expression contains macros, result in significant, frequently huge slow down. In my test, Newlisp's eval - for short expressions - is about twice as fast as the closest competitor - compiled Lispworks - and 100 times faster than PLT Scheme. It is especially important becaue Newlisp's eval is real, unrestricted eval able to access local variables.

Eval is the main reason I use Newlisp.

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

Kazimir Majorinc wrote:Eval is the main reason I use Newlisp.
Yes that was another excellent article Kazimir!

By spooky coincidence, I just happened to read this yesterday:
every CL book I have, and the commonly accepted consesus on comp.lang.lisp and irc.freemode.net#lisp is that use of eval in code is almost always a mistake
(This is 'in code' rather than interactively, though.)

ale870
Posts: 297
Joined: Mon Nov 26, 2007 8:01 pm
Location: Italy

Post by ale870 »

I red your article and it is very good!
Thank you for that in your blog @Kazimir !
--

Locked