From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA24968; Fri, 7 Nov 2003 10:32:27 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA25271 for ; Fri, 7 Nov 2003 10:32:25 +0100 (MET) Received: from bob.west.spy.net (mail.west.spy.net [66.149.231.226]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hA79WM126120 for ; Fri, 7 Nov 2003 10:32:23 +0100 (MET) Received: from [192.168.1.196] (dhcp-196.west.spy.net [192.168.1.196]) by bob.west.spy.net (Postfix) with ESMTP id B3F2559EA for ; Fri, 7 Nov 2003 01:32:19 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v606) Content-Transfer-Encoding: 7bit Message-Id: <483F0AC5-1105-11D8-AC71-000393CFE6B8@spy.net> Content-Type: text/plain; charset=US-ASCII; format=flowed To: Caml Mailing List From: Dustin Sallings Subject: [Caml-list] removing an item from a list efficiently Date: Fri, 7 Nov 2003 01:32:19 -0800 X-Mailer: Apple Mail (2.606) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; linked:01 implement:05 implement:05 slow:05 i'm:07 i'm:07 accesses:08 remove:89 removing:10 filter:13 efficiently:15 efficiently:15 spy:84 there:16 trying:17 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I'm trying to implement an LRU cache and I'm using a list to keep up with the accesses. I'm using filter to remove the item for repositioning it. That's very slow. Is there a better way to efficiently move a list item to the front, or should I just implement a linked list to meet my requirements? -- Dustin Sallings ------------------- 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