Construct OperationIntegerPower

Performance Diagrams

Construct OperationIntegerPower 002000000200000040000004000000600000060000008000000800000010000000100000001200000012000000140000001400000016000000160000001800000018000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)1913701188.95192307692307257.0CPython 2.712550390242.31730769230768342.05274840103135Nuitka (master)12150810395.6826923076923347.21250743469733Nuitka (develop)12149172549.0480769230769347.2336588569335Nuitka (factory)Construct OperationIntegerPowerTicks Construct OperationIntegerPower 0010000000100000002000000020000000300000003000000040000000400000005000000050000000600000006000000070000000700000008000000080000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)8062839988.95192307692307257.0CPython 3.574601410242.31730769230768275.47192457347063Nuitka (master)74199992395.6826923076923276.7022176797685Nuitka (develop)74199998549.0480769230769276.7021992905617Nuitka (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
266         tmp_assign_source_3 = tmp_mvar_value_4; 266         tmp_assign_source_3 = tmp_mvar_value_4;
267         assert(var_t == NULL); 267         assert(var_t == NULL);
268         Py_INCREF(tmp_assign_source_3); 268         Py_INCREF(tmp_assign_source_3);
269         var_t = tmp_assign_source_3; 269         var_t = tmp_assign_source_3;
270     } 270     }
n 271     { n
272         PyObject *tmp_assign_source_4;
273         PyObject *tmp_left_name_1;
274         PyObject *tmp_right_name_1;
275         CHECK_OBJECT(var_s);
276         tmp_left_name_1 = var_s;
277         CHECK_OBJECT(var_t);
278         tmp_right_name_1 = var_t;
279         tmp_assign_source_4 = BINARY_OPERATION_POW_OBJECT_OBJECT( tmp_left_name_1, tmp_right_name_1 );
280         if ( tmp_assign_source_4 == NULL )
281         {
282             assert(ERROR_OCCURRED());
283  
284             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
285  
286  
287             exception_lineno = 33;
288             type_description_1 = "ooo";
289             goto frame_exception_exit_1;
290         }
291         {
292             PyObject *old = var_t;
293             assert(old != NULL);
294             var_t = tmp_assign_source_4;
295             Py_DECREF(old);
296         }
297  
298     }
299 271
300 #if 0 272 #if 0
301     RESTORE_FRAME_EXCEPTION(frame_d7200350a690d93ae116a90937147470); 273     RESTORE_FRAME_EXCEPTION(frame_d7200350a690d93ae116a90937147470);
302 #endif 274 #endif
303 275
390     exception_tb = NULL; 362     exception_tb = NULL;
391     exception_lineno = 0; 363     exception_lineno = 0;
392 364
393     Py_XDECREF(var_s); 365     Py_XDECREF(var_s);
394     var_s = NULL; 366     var_s = NULL;
t 395   t
396     Py_XDECREF(var_t);
397     var_t = NULL;
398 367
399     Py_XDECREF(var_local_value); 368     Py_XDECREF(var_local_value);
400     var_local_value = NULL; 369     var_local_value = NULL;
401 370
402     // Re-raise. 371     // Re-raise.