Construct OperationIntegerPower

Performance Diagrams

Construct OperationIntegerPower 0010000001000000200000020000003000000300000040000004000000500000050000006000000600000070000007000000800000080000009000000900000010000000100000001100000011000000120000001200000013000000130000001400000014000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)1468642488.95192307692307257.0CPython 2.76600243242.31730769230768393.05897037186287Nuitka (master)5699951395.6826923076923408.20738252761663Nuitka (develop)5699951549.0480769230769408.20738252761663Nuitka (factory)Construct OperationIntegerPowerTicks Construct OperationIntegerPower 001000000010000000200000002000000030000000300000004000000040000000500000005000000060000000600000007000000070000000CPython 3.8Nuitka (master)Nuitka (develop)Nuitka (factory)7912800788.95192307692307257.0CPython 3.874150348242.31730769230768272.54514216779444Nuitka (master)74200000395.6826923076923272.39007983851167Nuitka (develop)74200000549.0480769230769272.39007983851167Nuitka (factory)Construct OperationIntegerPowerTicks

Source Code with Construct

module_value1 = -1
module_value2 = 17

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 = -1
module_value2 = 17

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_POW_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_f158e9af46f4a0fa53e5e57a26edac97); 237     RESTORE_FRAME_EXCEPTION(frame_f158e9af46f4a0fa53e5e57a26edac97);
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;