Construct InplaceOperationFloatAdd

Performance Diagrams

Construct InplaceOperationFloatAdd 0010000001000000200000020000003000000300000040000004000000500000050000006000000600000070000007000000800000080000009000000900000010000000100000001100000011000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)1177848688.95192307692307257.00000000000006CPython 2.7850039242.31730769230768486.28136805136467Nuitka (master)850039395.6826923076923486.28136805136467Nuitka (develop)850039549.0480769230769486.28136805136467Nuitka (factory)Construct InplaceOperationFloatAddTicks Construct InplaceOperationFloatAdd 0010000001000000200000020000003000000300000040000004000000500000050000006000000600000070000007000000800000080000009000000900000010000000100000001100000011000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)1117269388.95192307692307257.0CPython 3.5950083242.31730769230768483.10163923085304Nuitka (master)950083395.6826923076923483.10163923085304Nuitka (develop)950083549.0480769230769483.10163923085304Nuitka (factory)Construct InplaceOperationFloatAddTicks

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
45 static PyObject *const_str_plain_module_value2; 45 static PyObject *const_str_plain_module_value2;
46 static PyObject *const_str_digest_6ef8247cc21e46e907deaa5402874a3f; 46 static PyObject *const_str_digest_6ef8247cc21e46e907deaa5402874a3f;
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;
49 static PyObject *const_str_plain_calledRepeatedly; 49 static PyObject *const_str_plain_calledRepeatedly;
n 50 static PyObject *const_float_1000_0; n
51 static PyObject *const_str_angle_module; 50 static PyObject *const_str_angle_module;
52 static PyObject *const_str_plain_x; 51 static PyObject *const_str_plain_x;
53 static PyObject *const_str_digest_5ed1392909ad16e6227b8230f4582352; 52 static PyObject *const_str_digest_5ed1392909ad16e6227b8230f4582352;
54 extern PyObject *const_tuple_empty; 53 extern PyObject *const_tuple_empty;
55 static PyObject *const_str_plain_repeat; 54 static PyObject *const_str_plain_repeat;
75     const_str_plain_module_value1 = UNSTREAM_STRING_ASCII(&constant_bin[ 6 ], 13, 1); 74     const_str_plain_module_value1 = UNSTREAM_STRING_ASCII(&constant_bin[ 6 ], 13, 1);
76     const_tuple_str_plain_s_str_plain_local_value_tuple = PyTuple_New(2); 75     const_tuple_str_plain_s_str_plain_local_value_tuple = PyTuple_New(2);
77     PyTuple_SET_ITEM(const_tuple_str_plain_s_str_plain_local_value_tuple, 0, const_str_plain_s); Py_INCREF(const_str_plain_s); 76     PyTuple_SET_ITEM(const_tuple_str_plain_s_str_plain_local_value_tuple, 0, const_str_plain_s); Py_INCREF(const_str_plain_s);
78     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); 77     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);
79     const_str_plain_calledRepeatedly = UNSTREAM_STRING_ASCII(&constant_bin[ 76 ], 16, 1); 78     const_str_plain_calledRepeatedly = UNSTREAM_STRING_ASCII(&constant_bin[ 76 ], 16, 1);
n 80     const_float_1000_0 = UNSTREAM_FLOAT(&constant_bin[ 193 ]); n
81     const_str_angle_module = UNSTREAM_STRING_ASCII(&constant_bin[ 201 ], 8, 0); 79     const_str_angle_module = UNSTREAM_STRING_ASCII(&constant_bin[ 193 ], 8, 0);
82     const_str_plain_x = UNSTREAM_STRING_ASCII(&constant_bin[ 209 ], 1, 1); 80     const_str_plain_x = UNSTREAM_STRING_ASCII(&constant_bin[ 201 ], 1, 1);
83     const_str_digest_5ed1392909ad16e6227b8230f4582352 = UNSTREAM_STRING_ASCII(&constant_bin[ 210 ], 3, 0); 81     const_str_digest_5ed1392909ad16e6227b8230f4582352 = UNSTREAM_STRING_ASCII(&constant_bin[ 202 ], 3, 0);
84     const_str_plain_repeat = UNSTREAM_STRING_ASCII(&constant_bin[ 213 ], 6, 1); 82     const_str_plain_repeat = UNSTREAM_STRING_ASCII(&constant_bin[ 205 ], 6, 1);
85     const_tuple_none_int_pos_50000_tuple = PyTuple_New(2); 83     const_tuple_none_int_pos_50000_tuple = PyTuple_New(2);
86     PyTuple_SET_ITEM(const_tuple_none_int_pos_50000_tuple, 0, Py_None); Py_INCREF(Py_None); 84     PyTuple_SET_ITEM(const_tuple_none_int_pos_50000_tuple, 0, Py_None); Py_INCREF(Py_None);
87     PyTuple_SET_ITEM(const_tuple_none_int_pos_50000_tuple, 1, const_int_pos_50000); Py_INCREF(const_int_pos_50000); 85     PyTuple_SET_ITEM(const_tuple_none_int_pos_50000_tuple, 1, const_int_pos_50000); Py_INCREF(const_int_pos_50000);
n 88     const_float_3_0 = UNSTREAM_FLOAT(&constant_bin[ 219 ]); n 86     const_float_3_0 = UNSTREAM_FLOAT(&constant_bin[ 211 ]);
89 87
90     constants_created = true; 88     constants_created = true;
91 } 89 }
92 90
93 /* Function to verify module private constants for non-corruption. */ 91 /* Function to verify module private constants for non-corruption. */
266     } 264     }
267     { 265     {
268         PyObject *tmp_assign_source_3; 266         PyObject *tmp_assign_source_3;
269         PyObject *tmp_left_name_2; 267         PyObject *tmp_left_name_2;
270         PyObject *tmp_right_name_2; 268         PyObject *tmp_right_name_2;
n n 269         PyObject *tmp_mvar_value_4;
271         CHECK_OBJECT(var_s); 270         CHECK_OBJECT(var_s);
272         tmp_left_name_2 = var_s; 271         tmp_left_name_2 = var_s;
n 273         tmp_right_name_2 = const_float_1000_0; n
274         tmp_result = BINARY_OPERATION_ADD_OBJECT_FLOAT_INPLACE(&tmp_left_name_2, tmp_right_name_2);
275         if (tmp_result == false) {
276             assert(ERROR_OCCURRED());
277  
278             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
279  
280  
281             exception_lineno = 35;
282             type_description_1 = "oo";
283             goto frame_exception_exit_1;
284         }
285         tmp_assign_source_3 = tmp_left_name_2;
286         var_s = tmp_assign_source_3;
287  
288     }
289     {
290         PyObject *tmp_assign_source_4;
291         PyObject *tmp_left_name_3;
292         PyObject *tmp_right_name_3;
293         PyObject *tmp_mvar_value_4;
294         CHECK_OBJECT(var_s);
295         tmp_left_name_3 = var_s;
296         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);
297 273
298         if (unlikely(tmp_mvar_value_4 == NULL)) { 274         if (unlikely(tmp_mvar_value_4 == NULL)) {
299             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);
300         } 276         }
311             exception_lineno = 37; 287             exception_lineno = 37;
312             type_description_1 = "oo"; 288             type_description_1 = "oo";
313             goto frame_exception_exit_1; 289             goto frame_exception_exit_1;
314         } 290         }
315 291
n 316         tmp_right_name_3 = tmp_mvar_value_4; n 292         tmp_right_name_2 = tmp_mvar_value_4;
317         tmp_result = BINARY_OPERATION_ADD_OBJECT_OBJECT_INPLACE(&tmp_left_name_3, tmp_right_name_3); 293         tmp_result = BINARY_OPERATION_ADD_OBJECT_OBJECT_INPLACE(&tmp_left_name_2, tmp_right_name_2);
318         if (tmp_result == false) { 294         if (tmp_result == false) {
319             assert(ERROR_OCCURRED()); 295             assert(ERROR_OCCURRED());
320 296
321             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); 297             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
322 298
323 299
324             exception_lineno = 37; 300             exception_lineno = 37;
325             type_description_1 = "oo"; 301             type_description_1 = "oo";
326             goto frame_exception_exit_1; 302             goto frame_exception_exit_1;
327         } 303         }
t 328         tmp_assign_source_4 = tmp_left_name_3; t 304         tmp_assign_source_3 = tmp_left_name_2;
329         var_s = tmp_assign_source_4; 305         var_s = tmp_assign_source_3;
330 306
331     } 307     }
332 308
333 #if 0 309 #if 0
334     RESTORE_FRAME_EXCEPTION(frame_8daab9cc6d4668c6978422ef0afc9f1a); 310     RESTORE_FRAME_EXCEPTION(frame_8daab9cc6d4668c6978422ef0afc9f1a);