Construct OperationIntegerAdd

Performance Diagrams

Construct OperationIntegerAdd 0010000001000000200000020000003000000300000040000004000000500000050000006000000600000070000007000000800000080000009000000900000010000000100000001100000011000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)1103803088.95192307692307257.0CPython 2.74999988242.31730769230768392.17747923803853Nuitka (master)4999232395.6826923076923392.1944042899517Nuitka (develop)5000858549.0480769230769392.1580019957575Nuitka (factory)Construct OperationIntegerAddTicks Construct OperationIntegerAdd 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)1722882988.95192307692307257.0CPython 3.59999976242.31730769230768360.6843995272735Nuitka (master)9999938395.6826923076923360.68494456632493Nuitka (develop)10000034549.0480769230769360.68356762556346Nuitka (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
267         tmp_assign_source_3 = tmp_mvar_value_4; 267         tmp_assign_source_3 = tmp_mvar_value_4;
268         assert(var_t == NULL); 268         assert(var_t == NULL);
269         Py_INCREF(tmp_assign_source_3); 269         Py_INCREF(tmp_assign_source_3);
270         var_t = tmp_assign_source_3; 270         var_t = tmp_assign_source_3;
271     } 271     }
n 272     { n
273         PyObject *tmp_assign_source_4;
274         PyObject *tmp_left_name_1;
275         PyObject *tmp_right_name_1;
276         CHECK_OBJECT(var_s);
277         tmp_left_name_1 = var_s;
278         CHECK_OBJECT(var_t);
279         tmp_right_name_1 = var_t;
280         tmp_assign_source_4 = BINARY_OPERATION_ADD_OBJECT_OBJECT( tmp_left_name_1, tmp_right_name_1 );
281         if ( tmp_assign_source_4 == NULL )
282         {
283             assert(ERROR_OCCURRED());
284  
285             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
286  
287  
288             exception_lineno = 33;
289             type_description_1 = "ooo";
290             goto frame_exception_exit_1;
291         }
292         {
293             PyObject *old = var_t;
294             assert(old != NULL);
295             var_t = tmp_assign_source_4;
296             Py_DECREF(old);
297         }
298  
299     }
300 272
301 #if 0 273 #if 0
302     RESTORE_FRAME_EXCEPTION(frame_50266ad99cf9f86d95b4f2362ea9bb7a); 274     RESTORE_FRAME_EXCEPTION(frame_50266ad99cf9f86d95b4f2362ea9bb7a);
303 #endif 275 #endif
304 276
391     exception_tb = NULL; 363     exception_tb = NULL;
392     exception_lineno = 0; 364     exception_lineno = 0;
393 365
394     Py_XDECREF(var_s); 366     Py_XDECREF(var_s);
395     var_s = NULL; 367     var_s = NULL;
t 396   t
397     Py_XDECREF(var_t);
398     var_t = NULL;
399 368
400     Py_XDECREF(var_local_value); 369     Py_XDECREF(var_local_value);
401     var_local_value = NULL; 370     var_local_value = NULL;
402 371
403     // Re-raise. 372     // Re-raise.