Construct InplaceOperationStringAdd

Performance Diagrams

Construct InplaceOperationStringAdd 0010000001000000200000020000003000000300000040000004000000500000050000006000000600000070000007000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)711245589.78846153846155257.0CPython 2.75100124244.59615384615387326.91649845777044Nuitka (master)5003878399.4038461538462330.2604728390062Nuitka (develop)5019684554.2115384615385329.7113086236642Nuitka (factory)Construct InplaceOperationStringAddTicks Construct InplaceOperationStringAdd 00100000010000002000000200000030000003000000400000040000005000000500000060000006000000700000070000008000000800000090000009000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)804310789.78846153846155303.5787963454374CPython 3.59911286244.59615384615387257.00000000000006Nuitka (master)9419762399.4038461538462269.25503353527415Nuitka (develop)9418586554.2115384615385269.28435442181774Nuitka (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
252         assert( ERROR_OCCURRED() ); 252         assert( ERROR_OCCURRED() );
253 253
254         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 254         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
255 255
256 256
n 257         exception_lineno = 37; n
258         type_description_1 = "oo";
259         goto frame_exception_exit_1;
260     }
261     tmp_assign_source_3 = tmp_left_name_2;
262     var_s = tmp_assign_source_3;
263  
264     }
265     {
266     PyObject *tmp_assign_source_4;
267     PyObject *tmp_left_name_3;
268     PyObject *tmp_right_name_3;
269     CHECK_OBJECT( var_s );
270     tmp_left_name_3 = var_s;
271     CHECK_OBJECT( var_additiv );
272     tmp_right_name_3 = var_additiv;
273     tmp_result = BINARY_OPERATION_ADD_OBJECT_OBJECT_INPLACE( &tmp_left_name_3, tmp_right_name_3 );
274     if ( tmp_result == false )
275     {
276         assert( ERROR_OCCURRED() );
277  
278         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
279  
280  
281         exception_lineno = 41; 257         exception_lineno = 41;
282         type_description_1 = "oo"; 258         type_description_1 = "oo";
283         goto frame_exception_exit_1; 259         goto frame_exception_exit_1;
284     } 260     }
t 285     tmp_assign_source_4 = tmp_left_name_3; t 261     tmp_assign_source_3 = tmp_left_name_2;
286     var_s = tmp_assign_source_4; 262     var_s = tmp_assign_source_3;
287 263
288     } 264     }
289 265
290 #if 0 266 #if 0
291     RESTORE_FRAME_EXCEPTION( frame_509be686f457b372cab8ffa808aa4f68 ); 267     RESTORE_FRAME_EXCEPTION( frame_509be686f457b372cab8ffa808aa4f68 );