Construct OperationListIntegerIndexLookup

Performance Diagrams

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