Skip to content
Browse files

Remove extlib dependency.

  • Loading branch information...
1 parent df4f1bf commit e4606f57ac2a4cc2d442ecdfc98d1ac1e15183c5 @mfp committed Jun 19, 2009
Showing with 12 additions and 4 deletions.
  1. +0 −1 OMakefile
  2. +0 −1 README
  3. +12 −2 benchmark.ml
View
1 OMakefile
@@ -5,7 +5,6 @@ USE_OCAMLFIND = true
OCAMLPACKS[] =
unix
- extlib
OBJECTS[] =
size
View
1 README
@@ -22,7 +22,6 @@ Requirements
============
* OMake
* OCaml (any version should do)
-* ExtLib
Compiling and running
=====================
View
14 benchmark.ml
@@ -2,7 +2,6 @@
(* Copyright (C) 2009 Mauricio Fernandez <mfp@acm.org> http://eigenclass.org *)
open Printf
-open ExtArray
let time f x =
let t0 = Unix.gettimeofday () in
@@ -30,6 +29,17 @@ let shuffle a =
done;
a
+let rev a =
+ let a = Array.copy a in
+ let max = Array.length a - 1 in
+ for i = 0 to max / 2 - 1 do
+ let j = max - i in
+ let x = a.(i) in
+ a.(i) <- a.(j);
+ a.(j) <- x
+ done;
+ a
+
let sort a =
let a = Array.copy a in
Array.sort String.compare a;
@@ -202,7 +212,7 @@ struct
printf "%s:\n" id;
print_endline " strings";
let sorted = sort lines in
- let rev_sorted = Array.rev sorted in
+ let rev_sorted = rev sorted in
let sorted_strings' = sort strings' in
let shuffled = shuffle lines in
let h = timed_array "add" build lines in

0 comments on commit e4606f5

Please sign in to comment.
Something went wrong with that request. Please try again.