Construct OperationListIntegerIndexLookup

Performance Diagrams

Construct OperationListIntegerIndexLookup 00100000010000002000000200000030000003000000400000040000005000000500000060000006000000700000070000008000000800000090000009000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)909169889.78846153846155257.0CPython 2.74899972244.59615384615387370.9325110328465Nuitka (master)4899988399.4038461538462370.93207614750884Nuitka (develop)4900002554.2115384615385370.9316956228385Nuitka (factory)Construct OperationListIntegerIndexLookupTicks Construct OperationListIntegerIndexLookup 0010000001000000200000020000003000000300000040000004000000500000050000006000000600000070000007000000800000080000009000000900000010000000100000001100000011000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)1198391088.95192307692307257.0CPython 3.55350219242.31730769230768393.7906720665138Nuitka (master)5349633395.6826923076923393.8027557366502Nuitka (develop)5349791549.0480769230769393.7994976822448Nuitka (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
281         tmp_assign_source_3 = tmp_mvar_value_4; 281         tmp_assign_source_3 = tmp_mvar_value_4;
282         assert(var_t == NULL); 282         assert(var_t == NULL);
283         Py_INCREF(tmp_assign_source_3); 283         Py_INCREF(tmp_assign_source_3);
284         var_t = tmp_assign_source_3; 284         var_t = tmp_assign_source_3;
285     } 285     }
n 286     { n
287         PyObject *tmp_assign_source_4;
288         PyObject *tmp_subscribed_name_1;
289         PyObject *tmp_subscript_name_1;
290         CHECK_OBJECT(var_s);
291         tmp_subscribed_name_1 = var_s;
292         CHECK_OBJECT(var_t);
293         tmp_subscript_name_1 = var_t;
294         tmp_assign_source_4 = LOOKUP_SUBSCRIPT( tmp_subscribed_name_1, tmp_subscript_name_1 );
295         if ( tmp_assign_source_4 == NULL )
296         {
297             assert(ERROR_OCCURRED());
298  
299             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
300  
301  
302             exception_lineno = 33;
303             type_description_1 = "ooo";
304             goto frame_exception_exit_1;
305         }
306         {
307             PyObject *old = var_t;
308             assert(old != NULL);
309             var_t = tmp_assign_source_4;
310             Py_DECREF(old);
311         }
312  
313     }
314 286
315 #if 0 287 #if 0
316     RESTORE_FRAME_EXCEPTION(frame_fd879a83b1e65e10a787414dd98ad77c); 288     RESTORE_FRAME_EXCEPTION(frame_fd879a83b1e65e10a787414dd98ad77c);
317 #endif 289 #endif
318 290
405     exception_tb = NULL; 377     exception_tb = NULL;
406     exception_lineno = 0; 378     exception_lineno = 0;
407 379
408     Py_XDECREF(var_s); 380     Py_XDECREF(var_s);
409     var_s = NULL; 381     var_s = NULL;
t 410   t
411     Py_XDECREF(var_t);
412     var_t = NULL;
413 382
414     Py_XDECREF(var_local_value); 383     Py_XDECREF(var_local_value);
415     var_local_value = NULL; 384     var_local_value = NULL;
416 385
417     // Re-raise. 386     // Re-raise.