Construct OperationIntegerMul

Performance Diagrams

Construct OperationIntegerMul 001000000100000020000002000000300000030000004000000400000050000005000000600000060000007000000700000080000008000000900000090000001000000010000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)1063657988.95192307692307257.0CPython 2.73700251242.31730769230768418.14893346239063Nuitka (master)2847692395.6826923076923437.9560956328881Nuitka (develop)2847692549.0480769230769437.9560956328881Nuitka (factory)Construct OperationIntegerMulTicks Construct OperationIntegerMul 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000CPython 3.8Nuitka (master)Nuitka (develop)Nuitka (factory)1614502888.95192307692307257.0CPython 3.811300090242.31730769230768331.156496805561Nuitka (master)11350000395.6826923076923330.39257562523517Nuitka (develop)11350000549.0480769230769330.39257562523517Nuitka (factory)Construct OperationIntegerMulTicks

Source Code with Construct

module_value1 = 5000
module_value2 = 3000

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

    local_value = module_value1

    s = module_value1
    t = module_value2
# construct_begin
    t = s * t
# construct_end

    return s, t, local_value

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

print("OK.")

Source Code without Construct

module_value1 = 5000
module_value2 = 3000

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

    local_value = module_value1

    s = module_value1
    t = module_value2
# construct_begin



    return s, t, local_value

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

print("OK.")

Context Diff of Source Code


Construct
Baseline
28     local_value = module_value1 28     local_value = module_value1
29 29
30     s = module_value1 30     s = module_value1
31     t = module_value2 31     t = module_value2
32 # construct_begin 32 # construct_begin
t 33     t = s * t t 33  
34 # construct_end 34  
35 35
36     return s, t, local_value 36     return s, t, local_value
37 37
38 import itertools 38 import itertools
39 for x in itertools.repeat(None, 50000): 39 for x in itertools.repeat(None, 50000):

Context Diff of Generated Code


Construct
Baseline
229             goto frame_exception_exit_1; 229             goto frame_exception_exit_1;
230         } 230         }
231         assert(var_t == NULL); 231         assert(var_t == NULL);
232         Py_INCREF(tmp_assign_source_3); 232         Py_INCREF(tmp_assign_source_3);
233         var_t = tmp_assign_source_3; 233         var_t = tmp_assign_source_3;
n 234     } n
235     {
236         PyObject *tmp_assign_source_4;
237         PyObject *tmp_left_name_1;
238         PyObject *tmp_right_name_1;
239         CHECK_OBJECT(var_s);
240         tmp_left_name_1 = var_s;
241         CHECK_OBJECT(var_t);
242         tmp_right_name_1 = var_t;
243         tmp_assign_source_4 = BINARY_OPERATION_MULT_OBJECT_OBJECT_OBJECT(tmp_left_name_1, tmp_right_name_1);
244         if (tmp_assign_source_4 == NULL) {
245             assert(ERROR_OCCURRED());
246  
247             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
248  
249  
250             exception_lineno = 33;
251             type_description_1 = "ooo";
252             goto frame_exception_exit_1;
253         }
254         {
255             PyObject *old = var_t;
256             assert(old != NULL);
257             var_t = tmp_assign_source_4;
258             Py_DECREF(old);
259         }
260  
261     } 234     }
262 235
263 #if 0 236 #if 0
264     RESTORE_FRAME_EXCEPTION(frame_fe9c1046d77fd55b9d0427e79ea201b4); 237     RESTORE_FRAME_EXCEPTION(frame_fe9c1046d77fd55b9d0427e79ea201b4);
265 #endif 238 #endif
352 325
353     Py_XDECREF(var_local_value); 326     Py_XDECREF(var_local_value);
354     var_local_value = NULL; 327     var_local_value = NULL;
355     Py_XDECREF(var_s); 328     Py_XDECREF(var_s);
356     var_s = NULL; 329     var_s = NULL;
t 357     Py_XDECREF(var_t); t
358     var_t = NULL;
359     // Re-raise. 330     // Re-raise.
360     exception_type = exception_keeper_type_1; 331     exception_type = exception_keeper_type_1;
361     exception_value = exception_keeper_value_1; 332     exception_value = exception_keeper_value_1;
362     exception_tb = exception_keeper_tb_1; 333     exception_tb = exception_keeper_tb_1;
363     exception_lineno = exception_keeper_lineno_1; 334     exception_lineno = exception_keeper_lineno_1;