From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!freenix!teaser.fr!fr.clara.net!heighliner.fr.clara.net!newsgate.cistron.nl!news.tele.dk!small.news.tele.dk!195.54.122.107!newsfeed1.bredband.com!bredband!news01.chello.se!news01.chello.no!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: Cookbook question: How to change a list to a vector? References: <3c6cbb0f.18001906@nntp.interaccess.com> Mail-Copies-To: never From: Erik Naggum Message-ID: <3222835513335580@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 24 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 16 Feb 2002 08:05:10 GMT X-Complaints-To: abuse@chello.no X-Trace: news01.chello.no 1013846710 212.186.234.171 (Sat, 16 Feb 2002 09:05:10 MET) NNTP-Posting-Date: Sat, 16 Feb 2002 09:05:10 MET X-Received-Date: Sat, 16 Feb 2002 09:05:22 MET (news01.chello.no) Xref: archiver1.google.com comp.lang.lisp:26659 * Thaddeus L Olczyk | Given a system that is running slower than you would like. One thing | that you wish to do is replace a list with a vector since you can see | many inefficient operations on the list. How would one proceed? For what it is worth, I thought your question was quite clear, but the answer is also quite obvious: you hunt down all the references to the list and chnage the design to use a vector, instead, but this you knew. This is quite trivial, however, since the list is more than a "class": a data structure with methods, it embodies a particular design. In effect, your question translates to "how much of the design depends on the choice of the list data structure?" Individual programs differ greatly in this regard, but the more you have optimized your code for lists, the more work it will take to change to vectors. However, it is not very common to use nth to access list elements, and people tend to pass around other cons cells than the first in the list. This is especially true for those who suffer from Scheme exposure, who mistakenly believe that recursion on lists is a good thing. They have to redesign the whole solution to use another algorithm they are inexperienced with to get better performance. /// -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief.