Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Efficiency of 'a list
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-05-03 (23:18)
From: Eray Ozkural <exa@k...>
Subject: Re: [Caml-list] Efficiency of 'a list
Hi Mattias,

On Saturday 03 May 2003 21:43, Mattias Waldau wrote:
> I have been doing pure programming since MACLISP on the TOPS-20, and the
> a large percentage of performance problems can be traced back to
> IMAPPROPRIATE USE OF LISTS. Therefor my previous post where I
> essentially say:
> *** Do not use lists, there is always a better datastructure ***

I fully understand your concern. If you recall I said a similar thing:

>For instance, a naive implementation of an optimal comparison sorting 
>algorithm in LISP almost invariably results in an O(n^2logn) routine :)

That I had understood when we had been given an assignment to implement 
quicksort in our LISP course some years ago :) I had a quick look at how the 
other people did it, and realized that almost all of them had achieved this 
inappropriate complexity by using elt function.. However, you can of course 
implement quick sort (or some other comparison sorting like merge sort) using 
a linked list, the only problem would be that you can't do it in place (you 
can even implement randomized quicksort but you'd need two scans of the list 
instead of a single scan)

That's why the programmer must understand how "integral" data structures 
interact in a PL, especially in one that encompasses both imperative and 
functional semantics. Of course he must in addition to that have a good 
understanding of architectural/implementation issues, otherwise he can never 
predict the performance of his program.


Eray Ozkural (exa) <>
Comp. Sci. Dept., Bilkent University, Ankara  KDE Project:
www:  Malfunction:
GPG public key fingerprint: 360C 852F 88B0 A745 F31B  EA0F 7C07 AE16 874D 539C

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: