|
@@ -30,7 +30,7 @@
|
|
|
|
|
|
import modelverse_jit.source_map as source_map
|
|
|
|
|
|
-PROFILING = True
|
|
|
+PROFILING = False
|
|
|
|
|
|
NOP_LITERAL = None
|
|
|
"""A literal that results in a nop during which execution may be interrupted
|
|
@@ -458,7 +458,7 @@ class ReturnInstruction(VoidInstruction):
|
|
|
if self.value.has_definition():
|
|
|
self.value.generate_python_def(code_generator)
|
|
|
if PROFILING:
|
|
|
- code_generator.append_line("print('%s : %s' % (___profiling[1], time.time() - ___profiling[0]))")
|
|
|
+ code_generator.append_line("print('%s : %s : %s' % (___profiling[0], time.time() - ___profiling[1], time.time() - ___profiling[1] - ___profiling[2]))")
|
|
|
code_generator.append_line(
|
|
|
'raise PrimitiveFinished(' +
|
|
|
self.value.generate_python_use(code_generator) +
|
|
@@ -1009,7 +1009,11 @@ class StateInstruction(Instruction):
|
|
|
if arg_i.has_definition():
|
|
|
arg_i.generate_python_def(code_generator)
|
|
|
|
|
|
+ if PROFILING and "CALL" in self.get_opcode():
|
|
|
+ code_generator.append_line("___profiling_start = time.time()")
|
|
|
code_generator.append_state_definition(self, self.get_opcode(), args)
|
|
|
+ if PROFILING and "CALL" in self.get_opcode():
|
|
|
+ code_generator.append_line("___profiling[2] += (time.time() - ___profiling_start)")
|
|
|
|
|
|
def __repr__(self):
|
|
|
return "StateInstruction(%s)" % ', '.join(map(repr, self.get_arguments()))
|
|
@@ -1244,7 +1248,7 @@ class DefineFunctionInstruction(VariableInstruction):
|
|
|
code_generator.increase_indentation()
|
|
|
if PROFILING:
|
|
|
code_generator.append_line("import time")
|
|
|
- code_generator.append_line("___profiling = (time.time(), '%s')" % self.name)
|
|
|
+ code_generator.append_line("___profiling = ['%s', time.time(), 0.0]" % self.name)
|
|
|
self.body.generate_python_def(code_generator)
|
|
|
code_generator.decrease_indentation()
|
|
|
|