Construct InplaceOperationTupleAdd

Performance Diagrams

Construct InplaceOperationTupleAdd 0020000002000000400000040000006000000600000080000008000000100000001000000012000000120000001400000014000000160000001600000018000000180000002000000020000000220000002200000024000000240000002600000026000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)2708903688.95192307692307257.0CPython 2.715351170242.31730769230768364.0767993055879Nuitka (master)15351178395.6826923076923364.0767263268715Nuitka (develop)15350326549.0480769230769364.0844985601725Nuitka (factory)Construct InplaceOperationTupleAddTicks Construct InplaceOperationTupleAdd 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000180000001800000020000000200000002200000022000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)2232855088.95192307692307257.0CPython 3.515103519242.31730769230768336.96114008402145Nuitka (master)15101235395.6826923076923336.98641765638786Nuitka (develop)15101173549.0480769230769336.98710382516487Nuitka (factory)Construct InplaceOperationTupleAddTicks

Source Code with Construct

module_value1 = (5.0,)
module_value2 = (3.0,)

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

    # Make sure we have a local variable s anyway
    s = (2.0,)

    local_value = module_value1

    s += module_value1
# construct_begin
    s += (1000.0,)
# construct_end
    s += module_value2

    return s

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

print("OK.")

Source Code without Construct

module_value1 = (5.0,)
module_value2 = (3.0,)

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

    # Make sure we have a local variable s anyway
    s = (2.0,)

    local_value = module_value1

    s += module_value1
# construct_begin


    s += module_value2

    return s

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

print("OK.")

Context Diff of Source Code


Construct
Baseline
30 30
31     local_value = module_value1 31     local_value = module_value1
32 32
33     s += module_value1 33     s += module_value1
34 # construct_begin 34 # construct_begin
t 35     s += (1000.0,) t 35  
36 # construct_end 36  
37     s += module_value2 37     s += module_value2
38 38
39     return s 39     return s
40 40
41 import itertools 41 import itertools

Context Diff of Generated Code


Construct
Baseline
43 static PyObject *const_str_plain_module_value2; 43 static PyObject *const_str_plain_module_value2;
44 static PyObject *const_tuple_float_2_0_tuple; 44 static PyObject *const_tuple_float_2_0_tuple;
45 static PyObject *const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple; 45 static PyObject *const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple;
46 static PyObject *const_str_plain_module_value1; 46 static PyObject *const_str_plain_module_value1;
47 static PyObject *const_tuple_str_plain_s_str_plain_local_value_tuple; 47 static PyObject *const_tuple_str_plain_s_str_plain_local_value_tuple;
n 48 static PyObject *const_tuple_float_1000_0_tuple; n
49 static PyObject *const_str_plain_calledRepeatedly; 48 static PyObject *const_str_plain_calledRepeatedly;
n 50 static PyObject *const_float_1000_0; n
51 static PyObject *const_str_angle_module; 49 static PyObject *const_str_angle_module;
52 static PyObject *const_str_plain_None; 50 static PyObject *const_str_plain_None;
53 static PyObject *const_tuple_float_5_0_tuple; 51 static PyObject *const_tuple_float_5_0_tuple;
54 static PyObject *const_str_plain_x; 52 static PyObject *const_str_plain_x;
55 extern PyObject *const_tuple_empty; 53 extern PyObject *const_tuple_empty;
83     PyTuple_SET_ITEM( const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple, 0, const_str_digest_5ed1392909ad16e6227b8230f4582352 ); Py_INCREF(const_str_digest_5ed1392909ad16e6227b8230f4582352); 81     PyTuple_SET_ITEM( const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple, 0, const_str_digest_5ed1392909ad16e6227b8230f4582352 ); Py_INCREF(const_str_digest_5ed1392909ad16e6227b8230f4582352);
84     const_str_plain_module_value1 = UNSTREAM_STRING_ASCII( &constant_bin[ 6 ], 13, 1 ); 82     const_str_plain_module_value1 = UNSTREAM_STRING_ASCII( &constant_bin[ 6 ], 13, 1 );
85     const_tuple_str_plain_s_str_plain_local_value_tuple = PyTuple_New( 2 ); 83     const_tuple_str_plain_s_str_plain_local_value_tuple = PyTuple_New( 2 );
86     PyTuple_SET_ITEM( const_tuple_str_plain_s_str_plain_local_value_tuple, 0, const_str_plain_s ); Py_INCREF(const_str_plain_s); 84     PyTuple_SET_ITEM( const_tuple_str_plain_s_str_plain_local_value_tuple, 0, const_str_plain_s ); Py_INCREF(const_str_plain_s);
87     PyTuple_SET_ITEM( const_tuple_str_plain_s_str_plain_local_value_tuple, 1, const_str_plain_local_value ); Py_INCREF(const_str_plain_local_value); 85     PyTuple_SET_ITEM( const_tuple_str_plain_s_str_plain_local_value_tuple, 1, const_str_plain_local_value ); Py_INCREF(const_str_plain_local_value);
n 88     const_tuple_float_1000_0_tuple = PyTuple_New( 1 ); n
89     const_float_1000_0 = UNSTREAM_FLOAT( &constant_bin[ 147 ] );
90     PyTuple_SET_ITEM( const_tuple_float_1000_0_tuple, 0, const_float_1000_0 ); Py_INCREF(const_float_1000_0);
91     const_str_plain_calledRepeatedly = UNSTREAM_STRING_ASCII( &constant_bin[ 76 ], 16, 1 ); 86     const_str_plain_calledRepeatedly = UNSTREAM_STRING_ASCII( &constant_bin[ 76 ], 16, 1 );
n 92     const_str_angle_module = UNSTREAM_STRING_ASCII( &constant_bin[ 155 ], 8, 0 ); n 87     const_str_angle_module = UNSTREAM_STRING_ASCII( &constant_bin[ 147 ], 8, 0 );
93     const_str_plain_None = UNSTREAM_STRING_ASCII( &constant_bin[ 163 ], 4, 1 ); 88     const_str_plain_None = UNSTREAM_STRING_ASCII( &constant_bin[ 155 ], 4, 1 );
94     const_tuple_float_5_0_tuple = PyTuple_New( 1 ); 89     const_tuple_float_5_0_tuple = PyTuple_New( 1 );
95     PyTuple_SET_ITEM( const_tuple_float_5_0_tuple, 0, const_float_5_0 ); Py_INCREF(const_float_5_0); 90     PyTuple_SET_ITEM( const_tuple_float_5_0_tuple, 0, const_float_5_0 ); Py_INCREF(const_float_5_0);
n 96     const_str_plain_x = UNSTREAM_STRING_ASCII( &constant_bin[ 167 ], 1, 1 ); n 91     const_str_plain_x = UNSTREAM_STRING_ASCII( &constant_bin[ 159 ], 1, 1 );
97     const_str_plain_repeat = UNSTREAM_STRING_ASCII( &constant_bin[ 168 ], 6, 1 ); 92     const_str_plain_repeat = UNSTREAM_STRING_ASCII( &constant_bin[ 160 ], 6, 1 );
98     const_tuple_none_int_pos_50000_tuple = PyTuple_New( 2 ); 93     const_tuple_none_int_pos_50000_tuple = PyTuple_New( 2 );
99     PyTuple_SET_ITEM( const_tuple_none_int_pos_50000_tuple, 0, Py_None ); Py_INCREF(Py_None); 94     PyTuple_SET_ITEM( const_tuple_none_int_pos_50000_tuple, 0, Py_None ); Py_INCREF(Py_None);
100     PyTuple_SET_ITEM( const_tuple_none_int_pos_50000_tuple, 1, const_int_pos_50000 ); Py_INCREF(const_int_pos_50000); 95     PyTuple_SET_ITEM( const_tuple_none_int_pos_50000_tuple, 1, const_int_pos_50000 ); Py_INCREF(const_int_pos_50000);
n 101     const_float_3_0 = UNSTREAM_FLOAT( &constant_bin[ 174 ] ); n 96     const_float_3_0 = UNSTREAM_FLOAT( &constant_bin[ 166 ] );
102     const_tuple_float_3_0_tuple = PyTuple_New( 1 ); 97     const_tuple_float_3_0_tuple = PyTuple_New( 1 );
103     PyTuple_SET_ITEM( const_tuple_float_3_0_tuple, 0, const_float_3_0 ); Py_INCREF(const_float_3_0); 98     PyTuple_SET_ITEM( const_tuple_float_3_0_tuple, 0, const_float_3_0 ); Py_INCREF(const_float_3_0);
n 104     const_str_digest_47e6e791d6f4233ccee4ea29c2219618 = UNSTREAM_STRING_ASCII( &constant_bin[ 182 ], 49, 0 ); n 99     const_str_digest_47e6e791d6f4233ccee4ea29c2219618 = UNSTREAM_STRING_ASCII( &constant_bin[ 174 ], 49, 0 );
105 100
106     constants_created = true; 101     constants_created = true;
107 } 102 }
108 103
109 /* Function to verify module private constants for non-corruption. */ 104 /* Function to verify module private constants for non-corruption. */
269     } 264     }
270     { 265     {
271         PyObject *tmp_assign_source_3; 266         PyObject *tmp_assign_source_3;
272         PyObject *tmp_left_name_2; 267         PyObject *tmp_left_name_2;
273         PyObject *tmp_right_name_2; 268         PyObject *tmp_right_name_2;
n n 269         PyObject *tmp_mvar_value_4;
274         CHECK_OBJECT(var_s); 270         CHECK_OBJECT(var_s);
275         tmp_left_name_2 = var_s; 271         tmp_left_name_2 = var_s;
n 276         tmp_right_name_2 = const_tuple_float_1000_0_tuple; n
277         tmp_result = BINARY_OPERATION_ADD_OBJECT_TUPLE_INPLACE( &tmp_left_name_2, tmp_right_name_2 );
278         if ( tmp_result == false )
279         {
280             assert(ERROR_OCCURRED());
281  
282             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
283  
284  
285             exception_lineno = 35;
286             type_description_1 = "oo";
287             goto frame_exception_exit_1;
288         }
289         tmp_assign_source_3 = tmp_left_name_2;
290         var_s = tmp_assign_source_3;
291  
292     }
293     {
294         PyObject *tmp_assign_source_4;
295         PyObject *tmp_left_name_3;
296         PyObject *tmp_right_name_3;
297         PyObject *tmp_mvar_value_4;
298         CHECK_OBJECT(var_s);
299         tmp_left_name_3 = var_s;
300         tmp_mvar_value_4 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2); 272         tmp_mvar_value_4 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2);
301 273
302         if (unlikely( tmp_mvar_value_4 == NULL )) { 274         if (unlikely( tmp_mvar_value_4 == NULL )) {
303             tmp_mvar_value_4 = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2); 275             tmp_mvar_value_4 = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2);
304         } 276         }
316             exception_lineno = 37; 288             exception_lineno = 37;
317             type_description_1 = "oo"; 289             type_description_1 = "oo";
318             goto frame_exception_exit_1; 290             goto frame_exception_exit_1;
319         } 291         }
320 292
n 321         tmp_right_name_3 = tmp_mvar_value_4; n 293         tmp_right_name_2 = tmp_mvar_value_4;
322         tmp_result = BINARY_OPERATION_ADD_OBJECT_OBJECT_INPLACE( &tmp_left_name_3, tmp_right_name_3 ); 294         tmp_result = BINARY_OPERATION_ADD_OBJECT_OBJECT_INPLACE( &tmp_left_name_2, tmp_right_name_2 );
323         if ( tmp_result == false ) 295         if ( tmp_result == false )
324         { 296         {
325             assert(ERROR_OCCURRED()); 297             assert(ERROR_OCCURRED());
326 298
327             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); 299             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
329 301
330             exception_lineno = 37; 302             exception_lineno = 37;
331             type_description_1 = "oo"; 303             type_description_1 = "oo";
332             goto frame_exception_exit_1; 304             goto frame_exception_exit_1;
333         } 305         }
t 334         tmp_assign_source_4 = tmp_left_name_3; t 306         tmp_assign_source_3 = tmp_left_name_2;
335         var_s = tmp_assign_source_4; 307         var_s = tmp_assign_source_3;
336 308
337     } 309     }
338 310
339 #if 0 311 #if 0
340     RESTORE_FRAME_EXCEPTION(frame_88ad4d30c4cc913a99e2e6a0ec44c9b9); 312     RESTORE_FRAME_EXCEPTION(frame_88ad4d30c4cc913a99e2e6a0ec44c9b9);