caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] interesting array efficiency observations
@ 2004-05-08 18:13 briand
  2004-05-08 21:21 ` Yamagata Yoriyuki
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: briand @ 2004-05-08 18:13 UTC (permalink / raw)
  To: caml-list


I was investigating the use of 1-D bigarray's vs Array and noticed
 that the 1-D bigarray using c_layout seems to be slower than Array.

Is this an expected result ?

Thanks


Brian

------------------------------------------------------------

let n = 10000 in
let a = Array.create n 2. in
  for i = 0 to n-1 do
    for j = 0 to n-1 do
      a.(j) <- sqrt(a.(j) *. a.(j));
    done;
  done;

------------------------------------------------------------

(* #load "bigarray.cma";;*)

(* test file for big arrays. *)

(* #load "bigarray.cma";; *)

let n = 10000 in
let a = Bigarray.Array1.create Bigarray.float64 Bigarray.c_layout n in

  for i = 0 to n-1 do
    for j =0 to n-1 do
      a.{j} <- sqrt(a.{j} *. a.{j});
    done
  done
;;






-------------------
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] 9+ messages in thread

end of thread, other threads:[~2004-05-12 22:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-08 18:13 [Caml-list] interesting array efficiency observations briand
2004-05-08 21:21 ` Yamagata Yoriyuki
2004-05-08 22:45   ` Olivier Grisel
2004-05-09  0:25   ` Christophe TROESTLER
2004-05-09  0:48     ` Yamagata Yoriyuki
2004-05-09  8:24 ` Xavier Leroy
2004-05-09 14:07 ` malc
2004-05-11  5:04   ` briand
2004-05-12 15:30     ` Christophe TROESTLER

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).