Construct OperationIntegerAdd

Performance Diagrams

Construct OperationIntegerAdd 0010000001000000200000020000003000000300000040000004000000500000050000006000000600000070000007000000800000080000009000000900000010000000100000001100000011000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)1103803088.95192307692307257.0CPython 2.75000132242.31730769230768392.1742554186265Nuitka (master)4999376395.6826923076923392.1911804705397Nuitka (develop)4999952549.0480769230769392.1782851928915Nuitka (factory)Construct OperationIntegerAddTicks Construct OperationIntegerAdd 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)1722882988.95192307692307257.0CPython 3.59999696242.31730769230768360.6884156044946Nuitka (master)10000046395.6826923076923360.68339550796827Nuitka (develop)9999832549.0480769230769360.68646493841584Nuitka (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
262         tmp_assign_source_3 = tmp_mvar_value_4; 262         tmp_assign_source_3 = tmp_mvar_value_4;
263         assert(var_t == NULL); 263         assert(var_t == NULL);
264         Py_INCREF(tmp_assign_source_3); 264         Py_INCREF(tmp_assign_source_3);
265         var_t = tmp_assign_source_3; 265         var_t = tmp_assign_source_3;
266     } 266     }
n 267     { n
268         PyObject *tmp_assign_source_4;
269         PyObject *tmp_left_name_1;
270         PyObject *tmp_right_name_1;
271         CHECK_OBJECT(var_s);
272         tmp_left_name_1 = var_s;
273         CHECK_OBJECT(var_t);
274         tmp_right_name_1 = var_t;
275         tmp_assign_source_4 = BINARY_OPERATION_ADD_OBJECT_OBJECT(tmp_left_name_1, tmp_right_name_1);
276         if (tmp_assign_source_4 == NULL) {
277             assert(ERROR_OCCURRED());
278  
279             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
280  
281  
282             exception_lineno = 33;
283             type_description_1 = "ooo";
284             goto frame_exception_exit_1;
285         }
286         {
287             PyObject *old = var_t;
288             assert(old != NULL);
289             var_t = tmp_assign_source_4;
290             Py_DECREF(old);
291         }
292  
293     }
294 267
295 #if 0 268 #if 0
296     RESTORE_FRAME_EXCEPTION(frame_d91b943e50f21b2b640d30facd7e4c84); 269     RESTORE_FRAME_EXCEPTION(frame_d91b943e50f21b2b640d30facd7e4c84);
297 #endif 270 #endif
298 271
385     exception_tb = NULL; 358     exception_tb = NULL;
386     exception_lineno = 0; 359     exception_lineno = 0;
387 360
388     Py_XDECREF(var_s); 361     Py_XDECREF(var_s);
389     var_s = NULL; 362     var_s = NULL;
t 390   t
391     Py_XDECREF(var_t);
392     var_t = NULL;
393 363
394     Py_XDECREF(var_local_value); 364     Py_XDECREF(var_local_value);
395     var_local_value = NULL; 365     var_local_value = NULL;
396 366
397     // Re-raise. 367     // Re-raise.