Construct InplaceOperationStringAdd

Performance Diagrams

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