Construct InplaceOperationStringAdd

Performance Diagrams

Construct InplaceOperationStringAdd 0010000001000000200000020000003000000300000040000004000000500000050000006000000600000070000007000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)723086989.78846153846155257.0CPython 2.75349994244.59615384615387321.2790166767593Nuitka (master)5350000399.4038461538462321.278811626397Nuitka (develop)5350006554.2115384615385321.2786065760348Nuitka (factory)Construct InplaceOperationStringAddTicks Construct InplaceOperationStringAdd 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)1721337288.95192307692307257.00000000000006CPython 3.515930050242.31730769230768275.4233867492892Nuitka (master)15929906395.6826923076923275.42545401509767Nuitka (develop)15929890549.0480769230769275.42568371129863Nuitka (factory)Construct InplaceOperationStringAddTicks

Source Code with Construct

module_value1 = 5

additiv_global = '*' * 1000

def calledRepeatedly():
    # Force frame and eliminate forward propagation (currently).
    module_value1

    # Make sure we have a local variable s anyway
    s = '2'

    # Add an unknown, making 's' an unknown.
    additiv = additiv_global
    s += additiv

# construct_begin
    s += additiv
# construct_end

    # Prevent optimization into direct return.
    s += additiv

    return s

import itertools
for x in itertools.repeat(None, 10000):
    calledRepeatedly()

print("OK.")

Source Code without Construct

module_value1 = 5

additiv_global = '*' * 1000

def calledRepeatedly():
    # Force frame and eliminate forward propagation (currently).
    module_value1

    # Make sure we have a local variable s anyway
    s = '2'

    # Add an unknown, making 's' an unknown.
    additiv = additiv_global
    s += additiv

# construct_begin



    # Prevent optimization into direct return.
    s += additiv

    return s

import itertools
for x in itertools.repeat(None, 10000):
    calledRepeatedly()

print("OK.")

Context Diff of Source Code


Construct
Baseline
32     # Add an unknown, making 's' an unknown. 32     # Add an unknown, making 's' an unknown.
33     additiv = additiv_global 33     additiv = additiv_global
34     s += additiv 34     s += additiv
35 35
36 # construct_begin 36 # construct_begin
t 37     s += additiv t 37  
38 # construct_end 38  
39 39
40     # Prevent optimization into direct return. 40     # Prevent optimization into direct return.
41     s += additiv 41     s += additiv
42 42
43     return s 43     return s

Context Diff of Generated Code


Construct
Baseline
248             assert(ERROR_OCCURRED()); 248             assert(ERROR_OCCURRED());
249 249
250             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); 250             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
251 251
252 252
n 253             exception_lineno = 37; n
254             type_description_1 = "oo";
255             goto frame_exception_exit_1;
256         }
257         tmp_assign_source_3 = tmp_left_name_2;
258         var_s = tmp_assign_source_3;
259  
260     }
261     {
262         PyObject *tmp_assign_source_4;
263         PyObject *tmp_left_name_3;
264         PyObject *tmp_right_name_3;
265         CHECK_OBJECT(var_s);
266         tmp_left_name_3 = var_s;
267         CHECK_OBJECT(var_additiv);
268         tmp_right_name_3 = var_additiv;
269         tmp_result = BINARY_OPERATION_ADD_OBJECT_OBJECT_INPLACE( &tmp_left_name_3, tmp_right_name_3 );
270         if ( tmp_result == false )
271         {
272             assert(ERROR_OCCURRED());
273  
274             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
275  
276  
277             exception_lineno = 41; 253             exception_lineno = 41;
278             type_description_1 = "oo"; 254             type_description_1 = "oo";
279             goto frame_exception_exit_1; 255             goto frame_exception_exit_1;
280         } 256         }
t 281         tmp_assign_source_4 = tmp_left_name_3; t 257         tmp_assign_source_3 = tmp_left_name_2;
282         var_s = tmp_assign_source_4; 258         var_s = tmp_assign_source_3;
283 259
284     } 260     }
285 261
286 #if 0 262 #if 0
287     RESTORE_FRAME_EXCEPTION(frame_61226a47fa50b77af24d0d48fca8e290); 263     RESTORE_FRAME_EXCEPTION(frame_61226a47fa50b77af24d0d48fca8e290);