Browse Source

Search for cause of slow HUTN compile

Yentl Van Tendeloo 8 years ago
parent
commit
55cc844a27

+ 3 - 3
addis/PM_to_SCCD.mvc

@@ -211,7 +211,7 @@ Composite schedule {
                     String function value(model : Element, name : String, mapping : Element):
                         return "cd"!
                     $
-                value_parameter = $
+                value_parameters = $
                     Element function raise(model : Element, name : String, mapping : Element):
                         String code
                         Element result
@@ -305,7 +305,7 @@ Composite schedule {
                         else:
                             return result!
                     $
-                value_parameter = $
+                value_parameters = $
                     Element function raise(model : Element, name : String, mapping : Element):
                         String code
                         Element result
@@ -787,7 +787,7 @@ Composite schedule {
                     String function value(model : Element, name : String, mapping : Element):
                         return "local"!
                     $
-                value_parameter = $
+                value_parameters = $
                     Element function raise(model : Element, name : String, mapping : Element):
                         String code
                         Element result

+ 1 - 1
addis/SCCD_MetaModel.mvc

@@ -170,7 +170,7 @@ Class Raise{
     scope ?: EventScope
     port ?: String
     target ?: String
-    parameter ?: Action
+    parameters ?: Action
 }
 Association raise_parameters(Raise, ActualParameter){
     order : Natural

+ 1 - 6
bootstrap/compiler.alc

@@ -9,14 +9,9 @@ Element function generic_compile(code : String, port : String):
 	String response
 	response = comm_get(port)
 	if (response == "OK"):
-		Integer count
 		Element lst
 
-		lst = list_create()
-		count = comm_get(port)
-		while (count > 0):
-			list_append(lst, comm_get(port))
-			count = count - 1
+		lst = comm_get_list(port)
 
 		comm_close(port)
 		return lst!

+ 12 - 0
bootstrap/services.alc

@@ -79,3 +79,15 @@ Void function comm_close(comm : String):
 	if (string_startswith(comm, "__")):
 		dict_delete(read_root(), comm)
 	return!
+
+Element function comm_get_list(comm : String):
+	Integer length
+	Element result
+
+	length = comm_get(comm)
+	result = list_create()
+	while (length > 0):
+		list_append(result, comm_get(comm))
+		length = length - 1
+
+	return result!

+ 1 - 0
interface/HUTN/includes/services.alh

@@ -4,3 +4,4 @@ Void function comm_set(comm : String, value : Element)
 Element function comm_get(comm : String)
 String function comm_connect(service : String)
 Void function comm_close(comm : String)
+Element function comm_get_list(comm : String)

+ 4 - 0
scripts/HUTN_service.py

@@ -11,6 +11,7 @@ init()
 login("HUTN", "HUTN")
 
 def compile_service(port):
+    start = time.time()
     temp_file = ".tmp_%s" % port
     def compile_AL(code):
         code_fragments = code.split("\n")
@@ -25,7 +26,9 @@ def compile_service(port):
             f.write(code)
             f.flush()
 
+        ss = time.time()
         compiled = do_compile(temp_file, COMPILER_PATH + "/grammars/actionlanguage.g", "CS")
+        print("    Compile: %ss" % (time.time() - ss))
         os.remove(temp_file)
         return compiled
 
@@ -63,6 +66,7 @@ def compile_service(port):
     except Exception as e:
         service_set(port, str(e))
         raise
+    print("Compile took %ss" % (time.time() - start))
 
 service_register("compiler", compile_service)
 try: