From 9abbc22bd4001082681bffb881077a66e658a23a Mon Sep 17 00:00:00 2001 From: letouzey Date: Thu, 22 Aug 2013 14:29:31 +0000 Subject: More complete hashcons : lists (dirpath), arrays (constr) Earlier, the elements of constr arrays were hash-consed, but not the array itself. This helps a bit when the same (f a1 ... an) is manipulated a lot : -20% in the size of opaque terms in Integral_domain.vo and Nsatz.vo Similarly it's interesting to hash-cons sub-lists for dirpaths, since in Coq.A.B and Coq.A.C we could share Coq.A. With this patch, the hash-consing of constr seems quasi-optimal: Pierre-Marie's marshal compactor is unable to shrink opaque tables by more than 2%, and this difference seems to be due to untyped compaction (for the compactor Rel 1 = Prop Pos). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16723 85f007b7-540e-0410-9357-904b9bb8a0f7 --- kernel/sorts.ml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'kernel/sorts.ml') diff --git a/kernel/sorts.ml b/kernel/sorts.ml index 7ab6b553a..88c99683e 100644 --- a/kernel/sorts.ml +++ b/kernel/sorts.ml @@ -51,13 +51,12 @@ module Hsorts = type t = _t type u = universe -> universe let hashcons huniv = function - Prop c -> Prop c | Type u -> Type (huniv u) - let equal s1 s2 = - match (s1,s2) with - (Prop c1, Prop c2) -> c1 == c2 - | (Type u1, Type u2) -> u1 == u2 - |_ -> false + | s -> s + let equal s1 s2 = match (s1,s2) with + | (Prop c1, Prop c2) -> c1 == c2 + | (Type u1, Type u2) -> u1 == u2 + |_ -> false let hash = Hashtbl.hash end) -- cgit v1.2.3