Construct OperationListIntegerIndexLookup

Performance Diagrams

Construct OperationListIntegerIndexLookup 00100000010000002000000200000030000003000000400000040000005000000500000060000006000000700000070000008000000800000090000009000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)964283789.78846153846155257.0CPython 2.75350642244.59615384615387366.99536944046974Nuitka (master)5349990399.4038461538462367.012078136341Nuitka (develop)5350926554.2115384615385366.9880914195687Nuitka (factory)Construct OperationListIntegerIndexLookupTicks Construct OperationListIntegerIndexLookup 001000000100000020000002000000300000030000004000000400000050000005000000600000060000007000000700000080000008000000900000090000001000000010000000110000001100000012000000120000001300000013000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)1303084888.95192307692307257.0CPython 3.55445713242.31730769230768400.8435589828548Nuitka (master)5449723395.6826923076923400.7675138404122Nuitka (develop)5448183549.0480769230769400.7967182093303Nuitka (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
287         tmp_assign_source_3 = tmp_mvar_value_4; 287         tmp_assign_source_3 = tmp_mvar_value_4;
288         assert( var_t == NULL ); 288         assert( var_t == NULL );
289         Py_INCREF( tmp_assign_source_3 ); 289         Py_INCREF( tmp_assign_source_3 );
290         var_t = tmp_assign_source_3; 290         var_t = tmp_assign_source_3;
291     } 291     }
n 292     { n
293         PyObject *tmp_assign_source_4;
294         PyObject *tmp_subscribed_name_1;
295         PyObject *tmp_subscript_name_1;
296         CHECK_OBJECT( var_s );
297         tmp_subscribed_name_1 = var_s;
298         CHECK_OBJECT( var_t );
299         tmp_subscript_name_1 = var_t;
300         tmp_assign_source_4 = LOOKUP_SUBSCRIPT( tmp_subscribed_name_1, tmp_subscript_name_1 );
301         if ( tmp_assign_source_4 == NULL )
302         {
303             assert( ERROR_OCCURRED() );
304  
305             FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
306  
307  
308             exception_lineno = 33;
309             type_description_1 = "ooo";
310             goto frame_exception_exit_1;
311         }
312         {
313             PyObject *old = var_t;
314             assert( old != NULL );
315             var_t = tmp_assign_source_4;
316             Py_DECREF( old );
317         }
318  
319     }
320 292
321 #if 0 293 #if 0
322     RESTORE_FRAME_EXCEPTION( frame_35ab32734559e8f006cc61ffcfea66c5 ); 294     RESTORE_FRAME_EXCEPTION( frame_35ab32734559e8f006cc61ffcfea66c5 );
323 #endif 295 #endif
324 296
414     exception_tb = NULL; 386     exception_tb = NULL;
415     exception_lineno = 0; 387     exception_lineno = 0;
416 388
417     Py_XDECREF( var_s ); 389     Py_XDECREF( var_s );
418     var_s = NULL; 390     var_s = NULL;
t 419   t
420     Py_XDECREF( var_t );
421     var_t = NULL;
422 391
423     Py_XDECREF( var_local_value ); 392     Py_XDECREF( var_local_value );
424     var_local_value = NULL; 393     var_local_value = NULL;
425 394
426     // Re-raise. 395     // Re-raise.