aboutsummaryrefslogtreecommitdiff
path: root/mathcomp/ssreflect/fintype.v
diff options
context:
space:
mode:
authorAnton Trunov2018-11-16 10:55:30 +0100
committerAnton Trunov2018-12-04 14:25:53 +0100
commit79aa2b1ab5b233f103cd3e402094cd93d9028866 (patch)
tree4d3afa56b14db2de71dbd52c959e71c9766e66fb /mathcomp/ssreflect/fintype.v
parente99b8b9695cdb53492e63077cb0dd551c4a06dc3 (diff)
Remove `_ : Type` from packed classes
This increases performance 10% - 15% for Coq v8.6.1 - v8.9.dev. Tested on a Debain-based 16-core build server and a Macbook Pro laptop with 2,3 GHz Intel Core i5. | | Compilation time, old | Compilation | Speedup | | | (mathcomp commit 967088a6f87) | time, new | | | Coq 8.6.1 | 10min 33s | 9min 10s | 15% | | Coq 8.7.2 | 10min 12s | 8min 50s | 15% | | Coq 8.8.2 | 9min 39s | 8min 32s | 13% | | Coq 8.9.dev(05d827c800544) | 9min 12s | 8min 16s | 11% | | | | | | It seems Coq at some point fixed the problem `_ : Type` was supposed to solve.
Diffstat (limited to 'mathcomp/ssreflect/fintype.v')
-rw-r--r--mathcomp/ssreflect/fintype.v22
1 files changed, 11 insertions, 11 deletions
diff --git a/mathcomp/ssreflect/fintype.v b/mathcomp/ssreflect/fintype.v
index d4f564f..8be2eb0 100644
--- a/mathcomp/ssreflect/fintype.v
+++ b/mathcomp/ssreflect/fintype.v
@@ -172,7 +172,7 @@ Section Mixins.
Variable T : countType.
Definition EnumMixin :=
- let: Countable.Pack _ (Countable.Class _ m) _ as cT := T
+ let: Countable.Pack _ (Countable.Class _ m) as cT := T
return forall e : seq cT, axiom e -> mixin_of cT in
@Mixin (EqType _ _) m.
@@ -198,26 +198,26 @@ Section ClassDef.
Record class_of T := Class {
base : Choice.class_of T;
- mixin : mixin_of (Equality.Pack base T)
+ mixin : mixin_of (Equality.Pack base)
}.
Definition base2 T c := Countable.Class (@base T c) (mixin_base (mixin c)).
Local Coercion base : class_of >-> Choice.class_of.
-Structure type : Type := Pack {sort; _ : class_of sort; _ : Type}.
+Structure type : Type := Pack {sort; _ : class_of sort}.
Local Coercion sort : type >-> Sortclass.
Variables (T : Type) (cT : type).
-Definition class := let: Pack _ c _ as cT' := cT return class_of cT' in c.
-Definition clone c of phant_id class c := @Pack T c T.
-Let xT := let: Pack T _ _ := cT in T.
+Definition class := let: Pack _ c as cT' := cT return class_of cT' in c.
+Definition clone c of phant_id class c := @Pack T c.
+Let xT := let: Pack T _ := cT in T.
Notation xclass := (class : class_of xT).
Definition pack b0 (m0 : mixin_of (EqType T b0)) :=
fun bT b & phant_id (Choice.class bT) b =>
- fun m & phant_id m0 m => Pack (@Class T b m) T.
+ fun m & phant_id m0 m => Pack (@Class T b m).
-Definition eqType := @Equality.Pack cT xclass xT.
-Definition choiceType := @Choice.Pack cT xclass xT.
-Definition countType := @Countable.Pack cT (base2 xclass) xT.
+Definition eqType := @Equality.Pack cT xclass.
+Definition choiceType := @Choice.Pack cT xclass.
+Definition countType := @Countable.Pack cT (base2 xclass).
End ClassDef.
@@ -1379,7 +1379,7 @@ Coercion subFinType_subCountType sT := @SubCountType _ _ sT (subFin_mixin sT).
Canonical subFinType_subCountType.
Coercion subFinType_finType sT :=
- Pack (@Class sT (sub_choiceClass sT) (subFin_mixin sT)) sT.
+ Pack (@Class sT (sub_choiceClass sT) (subFin_mixin sT)).
Canonical subFinType_finType.
Lemma codom_val sT x : (x \in codom (val : sT -> T)) = P x.