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 VAA30681; Wed, 10 Oct 2001 21:34:49 +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 VAA30612 for ; Wed, 10 Oct 2001 21:34:48 +0200 (MET DST) Received: from ms1.surfglobal.net (eone.surfglobal.net [207.136.213.7]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f9AJYl107142 for ; Wed, 10 Oct 2001 21:34:47 +0200 (MET DST) Received: from vaiobambino (GILLIGAN [140.186.148.33]) by ms1.surfglobal.net with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 4KGRL7QT; Wed, 10 Oct 2001 15:34:40 -0400 From: "Jeff Henrikson" To: "Chris Hecker" Cc: , "Berke Durak" Subject: RE: [Caml-list] Some suggested improvements to the Graphics and Bigarray modules Date: Wed, 10 Oct 2001 15:47:40 -0400 Message-ID: <003c01c151c4$6ba686c0$0b01a8c0@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Importance: Normal In-Reply-To: <4.3.2.7.2.20011010000348.03039ba0@arda.pair.com> Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > >I also wrote one C function to do a special case of alpha composting bigarrays together in ARGB format. > > Did you try writing this in caml? I'd think you could get pretty close, speedwise, and it'd be interesting to find out. No, I didn't try. I would have had I felt it was easier to get correct on caml, but frankly, the code is so small that I didn't feel it was an advantage. Besides, C is pretty darn expressive when all you are doing is pushing bits. I still can't remember all the lsl lsr asr lor operations, (along with their fixity and precidence convention) by memory. And never mind that those names are all renamed randomly for int32s. They are made prefix rather than infix and the convention of the word "logical" is reversed: lsl (the l is for "logical") left_shift lsr (the l is for "logical") right_shift_logical asr (the a is for "arithmetic"?) shift_right lor logor On the other hand I can remember >> << ~ | and &. Also, I find the caml for loop's lack of functionality annoying. I really should learn camlp4 so I can write a real C-style for loop. (with break and continue, though it's not pertinent here.) Somebody doesn't have such things convieniently lying around do they? On performance, the conventional encoding of alpha uses all 8 bits. Since caml ints are only 31 bits, this means using int32s. Though I keep hearing stuff about int32s not being that slow, I have a hard time believing just from a machine op count point of view that using int32s could really compete in such an innermost loop as a pixel operation. The caml int32 vs C benchmark would be interesting, but I'm not sure interesting enough to overcome my threshold of laziness for me to go back and rewrite something that works. Oh, and then there's also the bytecode/asmcode interoperability problem, which is another vote for C. Jeff Henrikson > -----Original Message----- > From: Chris Hecker [mailto:checker@d6.com] > Sent: Wednesday, October 10, 2001 3:05 AM > To: Jeff Henrikson; Berke Durak > Cc: caml-list@inria.fr > Subject: RE: [Caml-list] Some suggested improvements to the Graphics and > Bigarray modules > > > > >I also wrote one C function to do a special case of alpha composting bigarrays together in ARGB format. > > Did you try writing this in caml? I'd think you could get pretty close, speedwise, and it'd be interesting to find out. > > Chris > ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr