From ... From: Erik Naggum Subject: Re: sorting... Date: 1998/12/15 Message-ID: <3122671946890928@naggum.no>#1/1 X-Deja-AN: 422316582 References: mail-copies-to: never Organization: Naggum Software; +47 8800 8879; http://www.naggum.no Newsgroups: comp.lang.lisp * David Bakhash | suppose that you have a list. You want to sort it. suppose that you | knew ahead of time that the list would be much closer to being sorted | if you reversed it. Would it make sense to call sort on the reversed | list rather than the list itself? would people think that this would | save time, or take more time? this is all wrong as an approach to improving performance. instead, study the available sort algorithms in the considerable literature and implement one that fits your data after you have discovered that the sorting time is significant to the rest of your work and worth fixing. I do (sort (cons ) ) when adding one element at a time to a priority list. profiling shows that it is irrelevant to the execution time of the program, although I'd bet that some form of programmer instinct would be triggered by this particular example and would try to rewrite it. #:Erik -- man who cooks while hacking eats food that has died twice.