Construct OperationIntegerPower

Performance Diagrams

Construct OperationIntegerPower 002000000200000040000004000000600000060000008000000800000010000000100000001200000012000000140000001400000016000000160000001800000018000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)1913701188.95192307692307257.0CPython 2.712550366242.31730769230768342.05305831197984Nuitka (master)12150006395.6826923076923347.2228894514726Nuitka (develop)12150792549.0480769230769347.2127398679087Nuitka (factory)Construct OperationIntegerPowerTicks Construct OperationIntegerPower 0010000000100000002000000020000000300000003000000040000000400000005000000050000000600000006000000070000000700000008000000080000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)8062839988.95192307692307257.0CPython 3.574601392242.31730769230768275.4719797410912Nuitka (master)74200130395.6826923076923276.7017947280109Nuitka (develop)74200470549.0480769230769276.7007526729557Nuitka (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
261         tmp_assign_source_3 = tmp_mvar_value_4; 261         tmp_assign_source_3 = tmp_mvar_value_4;
262         assert(var_t == NULL); 262         assert(var_t == NULL);
263         Py_INCREF(tmp_assign_source_3); 263         Py_INCREF(tmp_assign_source_3);
264         var_t = tmp_assign_source_3; 264         var_t = tmp_assign_source_3;
265     } 265     }
n 266     { n
267         PyObject *tmp_assign_source_4;
268         PyObject *tmp_left_name_1;
269         PyObject *tmp_right_name_1;
270         CHECK_OBJECT(var_s);
271         tmp_left_name_1 = var_s;
272         CHECK_OBJECT(var_t);
273         tmp_right_name_1 = var_t;
274         tmp_assign_source_4 = BINARY_OPERATION_POW_OBJECT_OBJECT(tmp_left_name_1, tmp_right_name_1);
275         if (tmp_assign_source_4 == NULL) {
276             assert(ERROR_OCCURRED());
277  
278             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
279  
280  
281             exception_lineno = 33;
282             type_description_1 = "ooo";
283             goto frame_exception_exit_1;
284         }
285         {
286             PyObject *old = var_t;
287             assert(old != NULL);
288             var_t = tmp_assign_source_4;
289             Py_DECREF(old);
290         }
291  
292     }
293 266
294 #if 0 267 #if 0
295     RESTORE_FRAME_EXCEPTION(frame_c74bbcd610596b30ad3e00a287a911f8); 268     RESTORE_FRAME_EXCEPTION(frame_c74bbcd610596b30ad3e00a287a911f8);
296 #endif 269 #endif
297 270
384     exception_tb = NULL; 357     exception_tb = NULL;
385     exception_lineno = 0; 358     exception_lineno = 0;
386 359
387     Py_XDECREF(var_s); 360     Py_XDECREF(var_s);
388     var_s = NULL; 361     var_s = NULL;
t 389   t
390     Py_XDECREF(var_t);
391     var_t = NULL;
392 362
393     Py_XDECREF(var_local_value); 363     Py_XDECREF(var_local_value);
394     var_local_value = NULL; 364     var_local_value = NULL;
395 365
396     // Re-raise. 366     // Re-raise.