Browse Source

Don't store result of visitors, which is extremely slow to store and check

Yentl Van Tendeloo 3 years ago
parent
commit
febb0cd7e6
2 changed files with 5 additions and 11 deletions
  1. 1 0
      bootstrap/semi_primitives.alc
  2. 4 11
      interface/HUTN/hutn_compiler/compiler.py

+ 1 - 0
bootstrap/semi_primitives.alc

@@ -317,6 +317,7 @@ Element function dict_copy(d : Element):
 	result = dict_create()
 
 	keys = dict_keys(d)
+	log("Copy " + cast_value(set_len(keys)))
 	while (set_len(keys) > 0):
 		key = set_pop(keys)
 		dict_add_fast(result, key, dict_read_node(d, key))

+ 4 - 11
interface/HUTN/hutn_compiler/compiler.py

@@ -163,21 +163,14 @@ def do_compile(inputfile, grammarfile, visitors=[], include_paths = [], mode="")
             else:
                 # The outer for finally finished, so there were no includes remaining, thus terminate the infinite while loop
                 break
-    tree_data = pickle.dumps(result["tree"], pickle.HIGHEST_PROTOCOL)
-    new_result = fetch_cached(tree_data, mode)
-    if new_result is None:
-        result["tree"].fix_tracability(inputfile)
 
-        for visitor in visitors:
-            visitor.visit(result["tree"])
+    result["tree"].fix_tracability(inputfile)
 
-        if visitors:
-            result = visitors[-1].dump()
-            make_cached(tree_data, result, mode)
-    else:
-        result = new_result
+    for visitor in visitors:
+        visitor.visit(result["tree"])
 
     if visitors:
+        result = visitors[-1].dump()
         return result
 
 def main(input_file, grammar_file, mode, args=[]):