Construct InplaceOperationTupleAdd

Performance Diagrams

Construct InplaceOperationTupleAdd 0020000002000000400000040000006000000600000080000008000000100000001000000012000000120000001400000014000000160000001600000018000000180000002000000020000000220000002200000024000000240000002600000026000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)2708903688.95192307692307257.0CPython 2.715351986242.31730769230768364.06935547651085Nuitka (master)15352054395.6826923076923364.0687351574211Nuitka (develop)15351212549.0480769230769364.0764161673266Nuitka (factory)Construct InplaceOperationTupleAddTicks Construct InplaceOperationTupleAdd 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000180000001800000020000000200000002200000022000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)2232855088.95192307692307257.0CPython 3.515103549242.31730769230768336.9608080668713Nuitka (master)15101084395.6826923076923336.988088809377Nuitka (develop)15101313549.0480769230769336.9855544117974Nuitka (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
44 static PyObject *const_str_plain_module_value2; 44 static PyObject *const_str_plain_module_value2;
45 static PyObject *const_tuple_float_2_0_tuple; 45 static PyObject *const_tuple_float_2_0_tuple;
46 static PyObject *const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple; 46 static PyObject *const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple;
47 static PyObject *const_str_plain_module_value1; 47 static PyObject *const_str_plain_module_value1;
48 static PyObject *const_tuple_str_plain_s_str_plain_local_value_tuple; 48 static PyObject *const_tuple_str_plain_s_str_plain_local_value_tuple;
n 49 static PyObject *const_tuple_float_1000_0_tuple; n
50 static PyObject *const_str_plain_calledRepeatedly; 49 static PyObject *const_str_plain_calledRepeatedly;
n 51 static PyObject *const_float_1000_0; n
52 static PyObject *const_str_angle_module; 50 static PyObject *const_str_angle_module;
53 static PyObject *const_str_plain_None; 51 static PyObject *const_str_plain_None;
54 static PyObject *const_tuple_float_5_0_tuple; 52 static PyObject *const_tuple_float_5_0_tuple;
55 static PyObject *const_str_plain_x; 53 static PyObject *const_str_plain_x;
56 extern PyObject *const_tuple_empty; 54 extern PyObject *const_tuple_empty;
84     PyTuple_SET_ITEM(const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple, 0, const_str_digest_5ed1392909ad16e6227b8230f4582352); Py_INCREF(const_str_digest_5ed1392909ad16e6227b8230f4582352); 82     PyTuple_SET_ITEM(const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple, 0, const_str_digest_5ed1392909ad16e6227b8230f4582352); Py_INCREF(const_str_digest_5ed1392909ad16e6227b8230f4582352);
85     const_str_plain_module_value1 = UNSTREAM_STRING_ASCII(&constant_bin[ 6 ], 13, 1); 83     const_str_plain_module_value1 = UNSTREAM_STRING_ASCII(&constant_bin[ 6 ], 13, 1);
86     const_tuple_str_plain_s_str_plain_local_value_tuple = PyTuple_New(2); 84     const_tuple_str_plain_s_str_plain_local_value_tuple = PyTuple_New(2);
87     PyTuple_SET_ITEM(const_tuple_str_plain_s_str_plain_local_value_tuple, 0, const_str_plain_s); Py_INCREF(const_str_plain_s); 85     PyTuple_SET_ITEM(const_tuple_str_plain_s_str_plain_local_value_tuple, 0, const_str_plain_s); Py_INCREF(const_str_plain_s);
88     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); 86     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 89     const_tuple_float_1000_0_tuple = PyTuple_New(1); n
90     const_float_1000_0 = UNSTREAM_FLOAT(&constant_bin[ 196 ]);
91     PyTuple_SET_ITEM(const_tuple_float_1000_0_tuple, 0, const_float_1000_0); Py_INCREF(const_float_1000_0);
92     const_str_plain_calledRepeatedly = UNSTREAM_STRING_ASCII(&constant_bin[ 76 ], 16, 1); 87     const_str_plain_calledRepeatedly = UNSTREAM_STRING_ASCII(&constant_bin[ 76 ], 16, 1);
n 93     const_str_angle_module = UNSTREAM_STRING_ASCII(&constant_bin[ 204 ], 8, 0); n 88     const_str_angle_module = UNSTREAM_STRING_ASCII(&constant_bin[ 196 ], 8, 0);
94     const_str_plain_None = UNSTREAM_STRING_ASCII(&constant_bin[ 212 ], 4, 1); 89     const_str_plain_None = UNSTREAM_STRING_ASCII(&constant_bin[ 204 ], 4, 1);
95     const_tuple_float_5_0_tuple = PyTuple_New(1); 90     const_tuple_float_5_0_tuple = PyTuple_New(1);
96     PyTuple_SET_ITEM(const_tuple_float_5_0_tuple, 0, const_float_5_0); Py_INCREF(const_float_5_0); 91     PyTuple_SET_ITEM(const_tuple_float_5_0_tuple, 0, const_float_5_0); Py_INCREF(const_float_5_0);
n 97     const_str_plain_x = UNSTREAM_STRING_ASCII(&constant_bin[ 216 ], 1, 1); n 92     const_str_plain_x = UNSTREAM_STRING_ASCII(&constant_bin[ 208 ], 1, 1);
98     const_str_plain_repeat = UNSTREAM_STRING_ASCII(&constant_bin[ 217 ], 6, 1); 93     const_str_plain_repeat = UNSTREAM_STRING_ASCII(&constant_bin[ 209 ], 6, 1);
99     const_tuple_none_int_pos_50000_tuple = PyTuple_New(2); 94     const_tuple_none_int_pos_50000_tuple = PyTuple_New(2);
100     PyTuple_SET_ITEM(const_tuple_none_int_pos_50000_tuple, 0, Py_None); Py_INCREF(Py_None); 95     PyTuple_SET_ITEM(const_tuple_none_int_pos_50000_tuple, 0, Py_None); Py_INCREF(Py_None);
101     PyTuple_SET_ITEM(const_tuple_none_int_pos_50000_tuple, 1, const_int_pos_50000); Py_INCREF(const_int_pos_50000); 96     PyTuple_SET_ITEM(const_tuple_none_int_pos_50000_tuple, 1, const_int_pos_50000); Py_INCREF(const_int_pos_50000);
n 102     const_float_3_0 = UNSTREAM_FLOAT(&constant_bin[ 223 ]); n 97     const_float_3_0 = UNSTREAM_FLOAT(&constant_bin[ 215 ]);
103     const_tuple_float_3_0_tuple = PyTuple_New(1); 98     const_tuple_float_3_0_tuple = PyTuple_New(1);
104     PyTuple_SET_ITEM(const_tuple_float_3_0_tuple, 0, const_float_3_0); Py_INCREF(const_float_3_0); 99     PyTuple_SET_ITEM(const_tuple_float_3_0_tuple, 0, const_float_3_0); Py_INCREF(const_float_3_0);
105 100
106     constants_created = true; 101     constants_created = true;
107 } 102 }
264     } 259     }
265     { 260     {
266         PyObject *tmp_assign_source_3; 261         PyObject *tmp_assign_source_3;
267         PyObject *tmp_left_name_2; 262         PyObject *tmp_left_name_2;
268         PyObject *tmp_right_name_2; 263         PyObject *tmp_right_name_2;
n n 264         PyObject *tmp_mvar_value_4;
269         CHECK_OBJECT(var_s); 265         CHECK_OBJECT(var_s);
270         tmp_left_name_2 = var_s; 266         tmp_left_name_2 = var_s;
n 271         tmp_right_name_2 = const_tuple_float_1000_0_tuple; n
272         tmp_result = BINARY_OPERATION_ADD_OBJECT_TUPLE_INPLACE(&tmp_left_name_2, tmp_right_name_2);
273         if (tmp_result == false) {
274             assert(ERROR_OCCURRED());
275  
276             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
277  
278  
279             exception_lineno = 35;
280             type_description_1 = "oo";
281             goto frame_exception_exit_1;
282         }
283         tmp_assign_source_3 = tmp_left_name_2;
284         var_s = tmp_assign_source_3;
285  
286     }
287     {
288         PyObject *tmp_assign_source_4;
289         PyObject *tmp_left_name_3;
290         PyObject *tmp_right_name_3;
291         PyObject *tmp_mvar_value_4;
292         CHECK_OBJECT(var_s);
293         tmp_left_name_3 = var_s;
294         tmp_mvar_value_4 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2); 267         tmp_mvar_value_4 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2);
295 268
296         if (unlikely(tmp_mvar_value_4 == NULL)) { 269         if (unlikely(tmp_mvar_value_4 == NULL)) {
297             tmp_mvar_value_4 = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2); 270             tmp_mvar_value_4 = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2);
298         } 271         }
309             exception_lineno = 37; 282             exception_lineno = 37;
310             type_description_1 = "oo"; 283             type_description_1 = "oo";
311             goto frame_exception_exit_1; 284             goto frame_exception_exit_1;
312         } 285         }
313 286
n 314         tmp_right_name_3 = tmp_mvar_value_4; n 287         tmp_right_name_2 = tmp_mvar_value_4;
315         tmp_result = BINARY_OPERATION_ADD_OBJECT_OBJECT_INPLACE(&tmp_left_name_3, tmp_right_name_3); 288         tmp_result = BINARY_OPERATION_ADD_OBJECT_OBJECT_INPLACE(&tmp_left_name_2, tmp_right_name_2);
316         if (tmp_result == false) { 289         if (tmp_result == false) {
317             assert(ERROR_OCCURRED()); 290             assert(ERROR_OCCURRED());
318 291
319             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); 292             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
320 293
321 294
322             exception_lineno = 37; 295             exception_lineno = 37;
323             type_description_1 = "oo"; 296             type_description_1 = "oo";
324             goto frame_exception_exit_1; 297             goto frame_exception_exit_1;
325         } 298         }
t 326         tmp_assign_source_4 = tmp_left_name_3; t 299         tmp_assign_source_3 = tmp_left_name_2;
327         var_s = tmp_assign_source_4; 300         var_s = tmp_assign_source_3;
328 301
329     } 302     }
330 303
331 #if 0 304 #if 0
332     RESTORE_FRAME_EXCEPTION(frame_2c3f03b3ebc33ea033e399a379961328); 305     RESTORE_FRAME_EXCEPTION(frame_2c3f03b3ebc33ea033e399a379961328);