projects
/
SXSI
/
xpathcomp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some more optimisations
[SXSI/xpathcomp.git]
/
ata.ml
diff --git
a/ata.ml
b/ata.ml
index
ebc74a5
..
6c97f55
100644
(file)
--- a/
ata.ml
+++ b/
ata.ml
@@
-1,8
+1,6
@@
INCLUDE "debug.ml"
INCLUDE "utils.ml"
INCLUDE "debug.ml"
INCLUDE "utils.ml"
-
-
type jump_kind = [ `TAG of Tag.t | `CONTAINS of string | `NOTHING ]
(* Todo : move elsewhere *)
type jump_kind = [ `TAG of Tag.t | `CONTAINS of string | `NOTHING ]
(* Todo : move elsewhere *)
@@
-67,8
+65,8
@@
struct
match f.pos with
| False -> 0
| True -> 1
match f.pos with
| False -> 0
| True -> 1
- | Or (f1,f2) -> HASHINT3(PRIME2,HNode.
hash f1,HNode.hash
f2)
- | And (f1,f2) -> HASHINT3(PRIME3,HNode.
hash f1,HNode.hash
f2)
+ | Or (f1,f2) -> HASHINT3(PRIME2,HNode.
uid f1,HNode.uid
f2)
+ | And (f1,f2) -> HASHINT3(PRIME3,HNode.
uid f1,HNode.uid
f2)
| Atom(d,p,s) -> HASHINT4(PRIME4,hash_const_variant d,vb p,s)
end
| Atom(d,p,s) -> HASHINT4(PRIME4,hash_const_variant d,vb p,s)
end
@@
-230,7
+228,7
@@
module SetTagKey =
struct
type t = Ptset.Int.t*Tag.t
let equal (s1,t1) (s2,t2) = (t1 == t2) && Ptset.Int.equal s1 s2
struct
type t = Ptset.Int.t*Tag.t
let equal (s1,t1) (s2,t2) = (t1 == t2) && Ptset.Int.equal s1 s2
- let hash (s,t) = HASHINT2(Ptset.Int.
hash s,Tag.hash
t)
+ let hash (s,t) = HASHINT2(Ptset.Int.
uid s,
t)
end
module TransTable = Hashtbl
end
module TransTable = Hashtbl
@@
-650,7
+648,7
@@
END
if Ptss.mem s c.sets then
{ c with results = IMap.add s (RS.concat r (IMap.find s c.results)) c.results}
else
if Ptss.mem s c.sets then
{ c with results = IMap.add s (RS.concat r (IMap.find s c.results)) c.results}
else
- { hash = HASHINT2(c.hash,Ptset.Int.
hash
s);
+ { hash = HASHINT2(c.hash,Ptset.Int.
uid
s);
sets = Ptss.add s c.sets;
results = IMap.add s r c.results
}
sets = Ptss.add s c.sets;
results = IMap.add s r c.results
}
@@
-682,7
+680,7
@@
END
in
let h,s =
Ptss.fold
in
let h,s =
Ptss.fold
- (fun s (ah,ass) -> (HASHINT2(ah,Ptset.Int.
hash
s),
+ (fun s (ah,ass) -> (HASHINT2(ah,Ptset.Int.
uid
s),
Ptss.add s ass))
(Ptss.union c1.sets c2.sets) (0,Ptss.empty)
in
Ptss.add s ass))
(Ptss.union c1.sets c2.sets) (0,Ptss.empty)
in
@@
-727,7
+725,7
@@
END
let h_trans = Hashtbl.create 4096
let get_up_trans slist ptag a tree =
let h_trans = Hashtbl.create 4096
let get_up_trans slist ptag a tree =
- let key = (HASHINT2(SList.
hash slist,Tag.hash
ptag)) in
+ let key = (HASHINT2(SList.
uid slist,
ptag)) in
try
Hashtbl.find h_trans key
with
try
Hashtbl.find h_trans key
with