X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=tree.ml;h=5327aa0f7a1493d3b64d92255909642364eab83c;hb=0c2338bfcdae0df1c68112a10247dc4e68a483ff;hp=7ea6f0337765b432c01add6681acbdfa9adb7eda;hpb=ac8c1ac563a2c089f789eed5a03ff5b84a2c4fe0;p=SXSI%2Fxpathcomp.git diff --git a/tree.ml b/tree.ml index 7ea6f03..5327aa0 100644 --- a/tree.ml +++ b/tree.ml @@ -133,9 +133,15 @@ external benchmark_jump : tree -> Tag.t -> unit = "caml_benchmark_jump" "noalloc let benchmark_jump t s = benchmark_jump t.doc s external benchmark_fcns : tree -> int = "caml_benchmark_fcns" "noalloc" +external benchmark_fene : tree -> int = "caml_benchmark_fene" "noalloc" +external benchmark_iter : tree -> int = "caml_benchmark_iter" "noalloc" let benchmark_fcns t = benchmark_fcns t.doc +let benchmark_fene t = benchmark_fene t.doc + +let benchmark_iter t = benchmark_iter t.doc + external benchmark_lcps : tree -> unit = "caml_benchmark_lcps" "noalloc" let benchmark_lcps t = benchmark_lcps t.doc @@ -491,7 +497,7 @@ let parent t n = tree_parent t.doc n let first_child t = let doc = t.doc in ();fun n -> tree_first_child doc n let first_element t = let doc = t.doc in (); fun n -> tree_first_element doc n - +let first_element t n = tree_first_element t.doc n (* these function will be called in two times: first partial application on the tag, then application of the tag and the tree, then application of the other arguments. We use the trick to let the compiler optimize application @@ -505,6 +511,7 @@ let select_child t = fun ts -> let next_sibling t = let doc = t.doc in (); fun n -> tree_next_sibling doc n let next_element t = let doc = t.doc in (); fun n -> tree_next_element doc n +let next_element t n = tree_next_element t.doc n let tagged_following_sibling t tag = (); fun n -> tree_tagged_following_sibling t.doc n tag