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 LAA05400; Sat, 24 Jul 2004 11:39:46 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA05856 for ; Sat, 24 Jul 2004 11:39:45 +0200 (MET DST) Received: from outbound28-2.lax.untd.com (outbound28-2.lax.untd.com [64.136.28.160]) by concorde.inria.fr (8.12.10/8.12.10) with SMTP id i6O9dhSH016809 for ; Sat, 24 Jul 2004 11:39:44 +0200 Received: from outbound28-2.lax.untd.com (smtp02.lax.untd.com [10.130.24.122]) by smtpout04.lax.untd.com with SMTP id AABASEMU6AJCLVJA for (sender ); Sat, 24 Jul 2004 02:39:40 -0700 (PDT) Received: (qmail 18140 invoked from network); 24 Jul 2004 09:38:47 -0000 Received: from unknown (HELO vangogh) (66.52.246.55) by smtp02.lax.untd.com with SMTP; 24 Jul 2004 09:38:47 -0000 From: "Brandon J. Van Every" To: "caml" Subject: RE: [Caml-list] Bigarray is a pig Date: Sat, 24 Jul 2004 02:49:12 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-ContentStamp: 10:5:456469415 X-UNTD-OriginStamp: CI84cOLHFqh7Zd2QWkwvEFvwyO3T/pIsFsCrOjjLH84h376IPbOH2QfIwZgbqdZP X-Miltered: at concorde with ID 41022E5F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; brandon:99 caml-list:01 unboxed:01 ocamlopt:01 avoiding:01 extern:01 extern:01 drill:99 caml-list:01 bayesian:01 crap:01 crap:01 unboxed:01 arrays:01 compiler:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Brian Hurt wrote: > Brand*n wrote: > > > > To C/C++ programmers interested in performance, this > > defeats the purpose of using unboxed array elements. If I > > wanted to pay > > function call overhead per element, for instance when > > communicating with OpenGL, I'd simply call functions. > > Function calls aren't that expensive. I'm pretty aware, from many years of experience, what the performance characteristics of C/C++ arrays are vs. function call access to comparable data, over millions of iterations. Unless ocamlopt has a way of avoiding EXTERN Bigarray declarations, we are talking about C code. In other words, yes function calls are expensive in C compared to the cost of just accessing an array element. > A function call to a known function takes 1-2 clock cycles. Not on any CPU I've worked on. Generally speaking, you must save state when you make function calls, and that is never a 1-2 clock cycle operation. If you have ways to inline stuff, great, but generally speaking you can't do that with EXTERN C library stubs. I don't know if OCaml has great compiler technology that other languages don't have. "It's not inlineable" is the drill in the C/C++ universe. Cheers, www.indiegamedesign.com Brand*n Van Every S*attle, WA Praise Be to the caml-list Bayesian filter! It blesseth my postings, it is evil crap! evil crap! Bigarray! Unboxed! Overhead! Wondering! chant chant chant... ------------------- 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