Construct OperationIntegerAdd
Performance Diagrams
Source Code with Construct
module_value1 = 5000 module_value2 = 3000 def calledRepeatedly(): # Force frame and eliminate forward propagation (currently). module_value1 local_value = module_value1 s = module_value1 t = module_value2 # construct_begin t = s + t # construct_end return s, t, local_value import itertools for x in itertools.repeat(None, 50000): calledRepeatedly() print("OK.")
Source Code without Construct
module_value1 = 5000 module_value2 = 3000 def calledRepeatedly(): # Force frame and eliminate forward propagation (currently). module_value1 local_value = module_value1 s = module_value1 t = module_value2 # construct_begin return s, t, local_value import itertools for x in itertools.repeat(None, 50000): calledRepeatedly() print("OK.")
Context Diff of Source Code
Construct | Baseline | ||||
---|---|---|---|---|---|
28 | local_value = module_value1 | 28 | local_value = module_value1 | ||
29 | 29 | ||||
30 | s = module_value1 | 30 | s = module_value1 | ||
31 | t = module_value2 | 31 | t = module_value2 | ||
32 | # construct_begin | 32 | # construct_begin | ||
t | 33 | t = s + t | t | 33 | |
34 | # construct_end | 34 | |||
35 | 35 | ||||
36 | return s, t, local_value | 36 | return s, t, local_value | ||
37 | 37 | ||||
38 | import itertools | 38 | import itertools | ||
39 | for x in itertools.repeat(None, 50000): | 39 | for x in itertools.repeat(None, 50000): |
Context Diff of Generated Code
Construct | Baseline | ||||
---|---|---|---|---|---|
229 | goto frame_exception_exit_1; | 229 | goto frame_exception_exit_1; | ||
230 | } | 230 | } | ||
231 | assert(var_t == NULL); | 231 | assert(var_t == NULL); | ||
232 | Py_INCREF(tmp_assign_source_3); | 232 | Py_INCREF(tmp_assign_source_3); | ||
233 | var_t = tmp_assign_source_3; | 233 | var_t = tmp_assign_source_3; | ||
n | 234 | } | n | ||
235 | { | ||||
236 | PyObject *tmp_assign_source_4; | ||||
237 | PyObject *tmp_left_value_1; | ||||
238 | PyObject *tmp_right_value_1; | ||||
239 | CHECK_OBJECT(var_s); | ||||
240 | tmp_left_value_1 = var_s; | ||||
241 | CHECK_OBJECT(var_t); | ||||
242 | tmp_right_value_1 = var_t; | ||||
243 | tmp_assign_source_4 = BINARY_OPERATION_ADD_OBJECT_OBJECT_OBJECT(tmp_left_value_1, tmp_right_value_1); | ||||
244 | if (tmp_assign_source_4 == NULL) { | ||||
245 | assert(ERROR_OCCURRED()); | ||||
246 | |||||
247 | FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); | ||||
248 | |||||
249 | |||||
250 | exception_lineno = 33; | ||||
251 | type_description_1 = "ooo"; | ||||
252 | goto frame_exception_exit_1; | ||||
253 | } | ||||
254 | { | ||||
255 | PyObject *old = var_t; | ||||
256 | assert(old != NULL); | ||||
257 | var_t = tmp_assign_source_4; | ||||
258 | Py_DECREF(old); | ||||
259 | } | ||||
260 | |||||
261 | } | 234 | } | ||
262 | 235 | ||||
263 | #if 0 | 236 | #if 0 | ||
264 | RESTORE_FRAME_EXCEPTION(frame_ec5e7dc91d6b4fb4ac19013b03aee48e); | 237 | RESTORE_FRAME_EXCEPTION(frame_ec5e7dc91d6b4fb4ac19013b03aee48e); | ||
265 | #endif | 238 | #endif | ||
352 | 325 | ||||
353 | Py_XDECREF(var_local_value); | 326 | Py_XDECREF(var_local_value); | ||
354 | var_local_value = NULL; | 327 | var_local_value = NULL; | ||
355 | Py_XDECREF(var_s); | 328 | Py_XDECREF(var_s); | ||
356 | var_s = NULL; | 329 | var_s = NULL; | ||
t | 357 | Py_XDECREF(var_t); | t | ||
358 | var_t = NULL; | ||||
359 | // Re-raise. | 330 | // Re-raise. | ||
360 | exception_type = exception_keeper_type_1; | 331 | exception_type = exception_keeper_type_1; | ||
361 | exception_value = exception_keeper_value_1; | 332 | exception_value = exception_keeper_value_1; | ||
362 | exception_tb = exception_keeper_tb_1; | 333 | exception_tb = exception_keeper_tb_1; | ||
363 | exception_lineno = exception_keeper_lineno_1; | 334 | exception_lineno = exception_keeper_lineno_1; |