]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
role aliasing: simplify hashRightRoleProperties
authorJustin Viiret <justin.viiret@intel.com>
Tue, 1 Dec 2015 22:47:59 +0000 (09:47 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Sun, 6 Dec 2015 22:38:32 +0000 (09:38 +1100)
Using the full report set for a suffix as an input to this hash was very
slow at scale.

src/rose/rose_build_role_aliasing.cpp

index 87b6936ccc0d93f95cc4a9d343bef652379c20aa..62db5b2eaf469368dd6d92408e2437da5102d0dd 100644 (file)
@@ -439,12 +439,16 @@ size_t hashRightRoleProperties(RoseVertex v, const RoseGraph &g) {
     hash_combine(val, hash_range(begin(props.reports), end(props.reports)));
 
     if (props.suffix) {
-        hash_combine(val, all_reports(props.suffix));
-        if (props.suffix.graph) {
-            hash_combine(val, num_vertices(*props.suffix.graph));
+        const auto &suffix = props.suffix;
+        if (suffix.castle) {
+            hash_combine(val, suffix.castle->reach());
+            hash_combine(val, suffix.castle->repeats.size());
         }
-        if (props.suffix.haig) {
-            hash_combine(val, hash_dfa(*props.suffix.haig));
+        if (suffix.graph) {
+            hash_combine(val, num_vertices(*suffix.graph));
+        }
+        if (suffix.haig) {
+            hash_combine(val, hash_dfa(*suffix.haig));
         }
     }