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 MAA06400; Mon, 2 Jun 2003 12:13:03 +0200 (MET DST) 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 MAA06411 for ; Mon, 2 Jun 2003 12:13:02 +0200 (MET DST) Received: from tyminouch.dyndns.org (pc4-cmbg2-5-cust143.cmbg.cable.ntl.com [81.100.86.143]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h52AD1T00487 for ; Mon, 2 Jun 2003 12:13:01 +0200 (MET DST) Received: from tyminouch.dyndns.org (tyminouch [127.0.0.1]) by tyminouch.dyndns.org (8.12.5/8.12.5) with ESMTP id h52AAkGo016940; Mon, 2 Jun 2003 12:10:46 +0200 Received: (from lefessan@localhost) by tyminouch.dyndns.org (8.12.5/8.12.5/Submit) id h52AAklo016937; Mon, 2 Jun 2003 12:10:46 +0200 From: Fabrice Le Fessant MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16091.8870.562522.681942@tyminouch.dyndns.org> Date: Mon, 2 Jun 2003 12:10:46 +0200 To: nr@eecs.harvard.edu (Norman Ramsey) Cc: caml-list@inria.fr Subject: Re: [Caml-list] implementing bit vectors in OCaml References: <20030601170317.002EF12F9CE@flatcoat.eecs.harvard.edu> X-Mailer: VM 7.14 under Emacs 21.2.1 X-Spam: no; 0.00; caml-list:01 vectors:01 scrutinizing:99 interfacing:01 implemented:01 pointers:01 tagged:01 ocaml:01 native:02 imperative:04 fabrice:04 array:04 efficient:05 integers:05 bits:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > We have a program that is spending a lot of time in set operations, > and we're thinking of trying an imperative implementation based on bit vectors. > I would hope that the basis of such an implementation would be an array > of native integers, but on scrutinizing the manual (espeically the chapter > on interfacing to C), I have concluded that such a thing is not possible. > Our choices appear to be > > * An array of native integers, which will be implemented as an array > of pointers to native integers, because integers are boxed. > > * An array of tagged integers, which will be less efficient as > dividing by 31 is more expensive than shifting. You can also lose some space, and use only 16 bits by integer, and the division will be less expensive. - Fabrice ------------------- 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