Quite right, I think.

3 things are important (in my experience):

Most important: the algorithm. For example I once made a fully vectorized
program for shortest paths that was much slower than a simpler
non-vectorized program, simply because my algorithm was not efficient. 

Second: appropiate use of input and output facilies (although to me this
nowadays seems less important)

Third: putting much effort in speed can be useful only if this effort does
not exceed the loss of time and money to produce the speed up. Of course
this depends on how many times the program will be used.

Mho, Jos

-----Original Message-----
From: racket-users@googlegroups.com [mailto:racket-users@googlegroups.com]
On Behalf Of Matthias Felleisen
Sent: lunes, 06 de abril de 2015 19:11
To: Lux
Cc: racket-users@googlegroups.com
Subject: Re: [racket-users] How to find most efficient
constructs/instructions beside benchmarking?


You almost never have to worry about the efficiency of (second x) (cadr x)
and (car (cdr x)). There are always bigger fish to fry than that. 


On Apr 6, 2015, at 3:37 AM, Lux <glsdes...@gmail.com> wrote:

> It is more efficient (second myList) or (car (cdr myList)) if it is any
difference at all?
> What are the principles I can keep in mind when I try to make code as
efficient as possible? Some basic functions are implemented in C in the
language. They are necessarily more fast to simple abstractions/helpers (in
Racket) based on them that can be reimplemented easily without requiring
libraries like racket/list in addition lo save memory and load times?
> I know readable code is generally better, but how can I save some
fractions of seconds here and there changing my constructs?
> 
> Lux
> 
> -- 
> You received this message because you are subscribed to the Google Groups
"Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to