Construct OperationIntegerAdd

Performance Diagrams

Construct OperationIntegerAdd 001000000100000020000002000000300000030000004000000400000050000005000000600000060000007000000700000080000008000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)823667589.78846153846155257.0CPython 2.72399929244.59615384615387432.1131048259532Nuitka (master)2399934399.4038461538462432.11295481676586Nuitka (develop)2399934554.2115384615385432.11295481676586Nuitka (factory)Construct OperationIntegerAddTicks Construct OperationIntegerAdd 00100000010000002000000200000030000003000000400000040000005000000500000060000006000000700000070000008000000800000090000009000000100000001000000011000000110000001200000012000000130000001300000014000000140000001500000015000000CPython 3.8Nuitka (master)Nuitka (develop)Nuitka (factory)1544527488.95192307692307257.0CPython 3.810700000242.31730769230768332.9216191059728Nuitka (master)10700000395.6826923076923332.9216191059728Nuitka (develop)10700000549.0480769230769332.9216191059728Nuitka (factory)Construct OperationIntegerAddTicks

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_name_1;
238         PyObject *tmp_right_name_1;
239         CHECK_OBJECT(var_s);
240         tmp_left_name_1 = var_s;
241         CHECK_OBJECT(var_t);
242         tmp_right_name_1 = var_t;
243         tmp_assign_source_4 = BINARY_OPERATION_ADD_OBJECT_OBJECT_OBJECT(tmp_left_name_1, tmp_right_name_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_d1382122b990983d6ca25b4ab0e67ca2); 237     RESTORE_FRAME_EXCEPTION(frame_d1382122b990983d6ca25b4ab0e67ca2);
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;