CLAZY: lazy calling in Common Lisp

This is a discussion on CLAZY: lazy calling in Common Lisp within the lisp forums in Programming Languages category; John Thingstad wrote: > På Mon, 16 Jun 2008 16:03:05 +0200, skrev vanekl <vanek @ acd.net>: > >> This algo appears to be more efficient than John's >> since it is not recomputing the factorization over and over again for >> each new test of primality. > > Appears being the operative word. > Goes back to the old saying that Lispers know the value of everything > and the cost of nothing. > > My algorithm can rest in the L1 cache. It doesn't need to access memory. > (no consing) > Although there are fewer iterations each step ...

Go Back   Application Development Forum > Programming Languages > lisp

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #11  
Old 06-16-2008, 11:14 AM
vanekl
Guest
 
Default Re: CLAZY: lazy calling in Common Lisp

John Thingstad wrote:
> På Mon, 16 Jun 2008 16:03:05 +0200, skrev vanekl <vanek@acd.net>:
>
>> This algo appears to be more efficient than John's
>> since it is not recomputing the factorization over and over again for
>> each new test of primality.

>
> Appears being the operative word.
> Goes back to the old saying that Lispers know the value of everything
> and the cost of nothing.
>
> My algorithm can rest in the L1 cache. It doesn't need to access memory.
> (no consing)
> Although there are fewer iterations each step is sufficiently expensive
> that you still loose.
> For bigger primes there are more efficient algorithms also so that one
> is never optimal.
>
> --------------
> John Thingstad



Agreed. From a high-level analysis, I like the lazy algo better.
Of course implementation details can totally destroy an algorithms
effectiveness, even if the algo has good big-O qualities. The virtual
machine ultimately has the last say, when running the algo in the
real world. However, this doesn't preclude the possibility, in the future,
for the lazy algo to come out faster if the virtual machine this is
run on has different optimizations.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 09:33 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.