Construct OperationListIntegerIndexLookup

Performance Diagrams

Construct OperationListIntegerIndexLookup 0010000001000000200000020000003000000300000040000004000000500000050000006000000600000070000007000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)703705789.78846153846155257.0CPython 2.74347269244.59615384615387351.4553946562954Nuitka (master)4349919399.4038461538462351.3623364688698Nuitka (develop)4349919554.2115384615385351.3623364688698Nuitka (factory)Construct OperationListIntegerIndexLookupTicks Construct OperationListIntegerIndexLookup 001000000100000020000002000000300000030000004000000400000050000005000000600000060000007000000700000080000008000000900000090000001000000010000000CPython 3.8Nuitka (master)Nuitka (develop)Nuitka (factory)1063310688.95192307692307257.0CPython 3.85049759242.31730769230768386.75803507894625Nuitka (master)5050221395.6826923076923386.74729811199677Nuitka (develop)5054367549.0480769230769386.6509442917099Nuitka (factory)Construct OperationListIntegerIndexLookupTicks

Source Code with Construct

module_value1 = [1,2,3,4,5]
module_value2 = 3

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,2,3,4,5]
module_value2 = 3

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_expression_name_1;
238         PyObject *tmp_subscript_name_1;
239         CHECK_OBJECT(var_s);
240         tmp_expression_name_1 = var_s;
241         CHECK_OBJECT(var_t);
242         tmp_subscript_name_1 = var_t;
243         tmp_assign_source_4 = LOOKUP_SUBSCRIPT(tmp_expression_name_1, tmp_subscript_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_67dac05885ab94f8c3bf2b867c4e5186); 237     RESTORE_FRAME_EXCEPTION(frame_67dac05885ab94f8c3bf2b867c4e5186);
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;