caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Efficiency of 'a list
@ 2003-05-02 19:27 Eray Ozkural
  2003-05-03  5:43 ` Mattias Waldau
  2003-05-03 21:13 ` Lauri Alanko
  0 siblings, 2 replies; 42+ messages in thread
From: Eray Ozkural @ 2003-05-02 19:27 UTC (permalink / raw)
  To: Ocaml Mailing List

Hi there,

In my maniacal pursuit of efficiency I figured that I don't truly understand 
the performance of ocaml lists.

Could somebody please point to an explanation of ocaml linked list 
implementation or summarize its performance characteristics? This might seem 
like a trivial question but having used many functional languages I know that 
it's easy to commit performance genocide using linked lists.

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

Therefore, it would be a good start to explain whether ocaml lists are in fact 
LISP lists and if not in what aspects they differ.

The motivation for this question comes from trying to understand the use of 
linked lists in an efficient algorithm, such as graph algorithms (say we are 
implementing topological sort)

Assume I'm using the following structure that is far from handsome:
type x = (int list) array

Let a's type be x. Consider codes as the following
a.(i) <- a.(i) @ [x;y;z]
a.(i) <- [x] :: a.(i)

What travesty results in execution of such codes with i coming from an 
arbitrary sequence? Do using such constructs result in unholy incarnations of 
space leaks or gross inefficiencies?

Another question, does ocaml make any effort to place members of a list close 
to each other? Or, more naturally, the list element is allocated using a 
global model and then simply linked inside the structure?

These questions may sound weird but I'm hoping it will make sense to somebody!

Regards,

-- 
Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
Comp. Sci. Dept., Bilkent University, Ankara  KDE Project: http://www.kde.org
www: http://www.cs.bilkent.edu.tr/~erayo  Malfunction: http://mp3.com/ariza
GPG public key fingerprint: 360C 852F 88B0 A745 F31B  EA0F 7C07 AE16 874D 539C

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2003-05-13 11:35 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-02 19:27 [Caml-list] Efficiency of 'a list Eray Ozkural
2003-05-03  5:43 ` Mattias Waldau
2003-05-03  8:16   ` Ville-Pertti Keinonen
2003-05-03 14:12   ` Vitaly Lugovsky
2003-05-03 18:43     ` Mattias Waldau
2003-05-03 20:01       ` Eray Ozkural
2003-05-03 23:17       ` Eray Ozkural
2003-05-04  2:08       ` cashin
2003-05-04  4:08         ` alc
2003-05-04  5:32           ` Ed L Cashin
2003-05-04  6:46           ` [Caml-list] Two types of efficiency (Was Efficiency of 'a list) Mattias Waldau
2003-05-04  7:35             ` John Max Skaller
2003-05-04 11:52               ` Olivier Andrieu
2003-05-05 11:04                 ` John Max Skaller
2003-05-04 16:48               ` brogoff
2003-05-04  7:43             ` Ville-Pertti Keinonen
2003-05-04 12:50               ` Eray Ozkural
2003-05-04 12:48             ` Eray Ozkural
2003-05-05  7:31             ` Diego Olivier Fernandez Pons
2003-05-05 11:11               ` Mattias Waldau
2003-05-05 13:17                 ` John Max Skaller
2003-05-05 11:49               ` Eray Ozkural
2003-05-05 11:57               ` Yaron M. Minsky
2003-05-05 13:32                 ` John Max Skaller
2003-05-06  2:49                   ` Nicolas Cannasse
2003-05-06 12:30                     ` Diego Olivier Fernandez Pons
2003-05-07  2:05                       ` Nicolas Cannasse
2003-05-05 16:38                 ` Diego Olivier Fernandez Pons
2003-05-05 18:05                   ` Eray Ozkural
2003-05-06 13:28                     ` Diego Olivier Fernandez Pons
2003-05-13 11:35                   ` [Caml-list] Data Structure Libraries (was: Two types of efficiency) Oleg Trott
2003-05-04  7:55           ` [Caml-list] Efficiency of 'a list Ville-Pertti Keinonen
2003-05-04 10:56             ` Neel Krishnaswami
2003-05-04 12:56               ` Eray Ozkural
2003-05-04 13:35                 ` Falk Hueffner
2003-05-04 12:38           ` Eray Ozkural
2003-05-04  8:07         ` Ville-Pertti Keinonen
2003-05-04 15:54           ` Ed L Cashin
2003-05-05 23:52           ` Garry Hodgson
2003-05-03 20:03   ` Eray Ozkural
2003-05-03 21:13 ` Lauri Alanko
2003-05-03 22:03   ` Eray Ozkural

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).