Construct InplaceOperationIntegerMul

Performance Diagrams

Construct InplaceOperationIntegerMul 00100000010000002000000200000030000003000000400000040000005000000500000060000006000000700000070000008000000800000090000009000000100000001000000011000000110000001200000012000000130000001300000014000000140000001500000015000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)1518071688.95192307692307257.0CPython 2.710049990242.31730769230768340.51920481525076Nuitka (master)10050032395.6826923076923340.51852112904294Nuitka (develop)10050056549.0480769230769340.5181304512099Nuitka (factory)Construct InplaceOperationIntegerMulTicks Construct InplaceOperationIntegerMul 002000000200000040000004000000600000060000008000000800000010000000100000001200000012000000140000001400000016000000160000001800000018000000200000002000000022000000220000002400000024000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)2542035188.95192307692307257.0CPython 3.521400133242.31730769230768296.08119590117747Nuitka (master)21400320395.6826923076923296.0793780436301Nuitka (develop)21400076549.0480769230769296.0817500074887Nuitka (factory)Construct InplaceOperationIntegerMulTicks

Source Code with Construct

module_value1 = 5
module_value2 = 3

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

    # Make sure we have a local variable x anyway
    s = 2

    local_value = module_value1

    s *= module_value1
# construct_begin
    s *= 1000
# 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
module_value2 = 3

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

    # Make sure we have a local variable x anyway
    s = 2

    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 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
39 static PyObject *const_int_pos_3; 39 static PyObject *const_int_pos_3;
40 static PyObject *const_str_plain_local_value; 40 static PyObject *const_str_plain_local_value;
41 static PyObject *const_int_pos_50000; 41 static PyObject *const_int_pos_50000;
42 static PyObject *const_str_plain_module_value2; 42 static PyObject *const_str_plain_module_value2;
43 static PyObject *const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple; 43 static PyObject *const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple;
n 44 static PyObject *const_int_pos_1000; n
45 static PyObject *const_str_plain_module_value1; 44 static PyObject *const_str_plain_module_value1;
46 static PyObject *const_tuple_str_plain_s_str_plain_local_value_tuple; 45 static PyObject *const_tuple_str_plain_s_str_plain_local_value_tuple;
47 static PyObject *const_str_plain_calledRepeatedly; 46 static PyObject *const_str_plain_calledRepeatedly;
48 static PyObject *const_str_angle_module; 47 static PyObject *const_str_angle_module;
49 static PyObject *const_str_plain_None; 48 static PyObject *const_str_plain_None;
72     const_int_pos_50000 = PyLong_FromUnsignedLong(50000ul); 71     const_int_pos_50000 = PyLong_FromUnsignedLong(50000ul);
73     const_str_plain_module_value2 = UNSTREAM_STRING_ASCII( &constant_bin[ 41 ], 13, 1 ); 72     const_str_plain_module_value2 = UNSTREAM_STRING_ASCII( &constant_bin[ 41 ], 13, 1 );
74     const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple = PyTuple_New( 1 ); 73     const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple = PyTuple_New( 1 );
75     const_str_digest_5ed1392909ad16e6227b8230f4582352 = UNSTREAM_STRING_ASCII( &constant_bin[ 128 ], 3, 0 ); 74     const_str_digest_5ed1392909ad16e6227b8230f4582352 = UNSTREAM_STRING_ASCII( &constant_bin[ 128 ], 3, 0 );
76     PyTuple_SET_ITEM( const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple, 0, const_str_digest_5ed1392909ad16e6227b8230f4582352 ); Py_INCREF(const_str_digest_5ed1392909ad16e6227b8230f4582352); 75     PyTuple_SET_ITEM( const_tuple_str_digest_5ed1392909ad16e6227b8230f4582352_tuple, 0, const_str_digest_5ed1392909ad16e6227b8230f4582352 ); Py_INCREF(const_str_digest_5ed1392909ad16e6227b8230f4582352);
n 77     const_int_pos_1000 = PyLong_FromUnsignedLong(1000ul); n
78     const_str_plain_module_value1 = UNSTREAM_STRING_ASCII( &constant_bin[ 6 ], 13, 1 ); 76     const_str_plain_module_value1 = UNSTREAM_STRING_ASCII( &constant_bin[ 6 ], 13, 1 );
79     const_tuple_str_plain_s_str_plain_local_value_tuple = PyTuple_New( 2 ); 77     const_tuple_str_plain_s_str_plain_local_value_tuple = PyTuple_New( 2 );
80     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, 0, const_str_plain_s ); Py_INCREF(const_str_plain_s);
81     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     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);
82     const_str_plain_calledRepeatedly = UNSTREAM_STRING_ASCII( &constant_bin[ 76 ], 16, 1 ); 80     const_str_plain_calledRepeatedly = UNSTREAM_STRING_ASCII( &constant_bin[ 76 ], 16, 1 );
257     } 255     }
258     { 256     {
259         PyObject *tmp_assign_source_3; 257         PyObject *tmp_assign_source_3;
260         PyObject *tmp_left_name_2; 258         PyObject *tmp_left_name_2;
261         PyObject *tmp_right_name_2; 259         PyObject *tmp_right_name_2;
n n 260         PyObject *tmp_mvar_value_4;
262         CHECK_OBJECT(var_s); 261         CHECK_OBJECT(var_s);
263         tmp_left_name_2 = var_s; 262         tmp_left_name_2 = var_s;
n 264         tmp_right_name_2 = const_int_pos_1000; n
265         tmp_result = BINARY_OPERATION_MUL_INPLACE( &tmp_left_name_2, tmp_right_name_2 );
266         if ( tmp_result == false )
267         {
268             assert(ERROR_OCCURRED());
269  
270             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
271  
272  
273             exception_lineno = 35;
274             type_description_1 = "oo";
275             goto frame_exception_exit_1;
276         }
277         tmp_assign_source_3 = tmp_left_name_2;
278         var_s = tmp_assign_source_3;
279  
280     }
281     {
282         PyObject *tmp_assign_source_4;
283         PyObject *tmp_left_name_3;
284         PyObject *tmp_right_name_3;
285         PyObject *tmp_mvar_value_4;
286         CHECK_OBJECT(var_s);
287         tmp_left_name_3 = var_s;
288         tmp_mvar_value_4 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2); 263         tmp_mvar_value_4 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2);
289 264
290         if (unlikely( tmp_mvar_value_4 == NULL )) { 265         if (unlikely( tmp_mvar_value_4 == NULL )) {
291             tmp_mvar_value_4 = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2); 266             tmp_mvar_value_4 = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2);
292         } 267         }
304             exception_lineno = 37; 279             exception_lineno = 37;
305             type_description_1 = "oo"; 280             type_description_1 = "oo";
306             goto frame_exception_exit_1; 281             goto frame_exception_exit_1;
307         } 282         }
308 283
n 309         tmp_right_name_3 = tmp_mvar_value_4; n 284         tmp_right_name_2 = tmp_mvar_value_4;
310         tmp_result = BINARY_OPERATION_MUL_INPLACE( &tmp_left_name_3, tmp_right_name_3 ); 285         tmp_result = BINARY_OPERATION_MUL_INPLACE( &tmp_left_name_2, tmp_right_name_2 );
311         if ( tmp_result == false ) 286         if ( tmp_result == false )
312         { 287         {
313             assert(ERROR_OCCURRED()); 288             assert(ERROR_OCCURRED());
314 289
315             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); 290             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
317 292
318             exception_lineno = 37; 293             exception_lineno = 37;
319             type_description_1 = "oo"; 294             type_description_1 = "oo";
320             goto frame_exception_exit_1; 295             goto frame_exception_exit_1;
321         } 296         }
t 322         tmp_assign_source_4 = tmp_left_name_3; t 297         tmp_assign_source_3 = tmp_left_name_2;
323         var_s = tmp_assign_source_4; 298         var_s = tmp_assign_source_3;
324 299
325     } 300     }
326 301
327 #if 0 302 #if 0
328     RESTORE_FRAME_EXCEPTION(frame_7e2139f5b4c1ac2b46062aa22a983d16); 303     RESTORE_FRAME_EXCEPTION(frame_7e2139f5b4c1ac2b46062aa22a983d16);