Construct OperationListIntegerIndexLookup

Performance Diagrams

Construct OperationListIntegerIndexLookup 00100000010000002000000200000030000003000000400000040000005000000500000060000006000000700000070000008000000800000090000009000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)984274489.78846153846155257.0CPython 2.75350830244.59615384615387369.77556906582464Nuitka (master)5349990399.4038461538462369.79665840057487Nuitka (develop)5351022554.2115384615385369.77074864645317Nuitka (factory)Construct OperationListIntegerIndexLookupTicks Construct OperationListIntegerIndexLookup 00100000010000002000000200000030000003000000400000040000005000000500000060000006000000700000070000008000000800000090000009000000100000001000000011000000110000001200000012000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)1293097788.95192307692307257.0CPython 3.55445370242.31730769230768400.05250507247945Nuitka (master)5449611395.6826923076923399.97145811476287Nuitka (develop)5449669549.0480769230769399.97034971496385Nuitka (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
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
292     } 292     }
n 293     { n
294     PyObject *tmp_assign_source_4;
295     PyObject *tmp_subscribed_name_1;
296     PyObject *tmp_subscript_name_1;
297     CHECK_OBJECT( var_s );
298     tmp_subscribed_name_1 = var_s;
299     CHECK_OBJECT( var_t );
300     tmp_subscript_name_1 = var_t;
301     tmp_assign_source_4 = LOOKUP_SUBSCRIPT( tmp_subscribed_name_1, tmp_subscript_name_1 );
302     if ( tmp_assign_source_4 == NULL )
303     {
304         assert( ERROR_OCCURRED() );
305  
306         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
307  
308  
309         exception_lineno = 33;
310         type_description_1 = "ooo";
311         goto frame_exception_exit_1;
312     }
313     {
314         PyObject *old = var_t;
315         assert( old != NULL );
316         var_t = tmp_assign_source_4;
317         Py_DECREF( old );
318     }
319  
320     }
321 293
322 #if 0 294 #if 0
323     RESTORE_FRAME_EXCEPTION( frame_d727359bf2fa08a0e3a72b5b1a60ff6c ); 295     RESTORE_FRAME_EXCEPTION( frame_d727359bf2fa08a0e3a72b5b1a60ff6c );
324 #endif 296 #endif
325 297
424     exception_lineno = 0; 396     exception_lineno = 0;
425 397
426     { 398     {
427     Py_XDECREF( var_s ); 399     Py_XDECREF( var_s );
428     var_s = NULL; 400     var_s = NULL;
t 429   t
430     }
431     {
432     Py_XDECREF( var_t );
433     var_t = NULL;
434 401
435     } 402     }
436     { 403     {
437     Py_XDECREF( var_local_value ); 404     Py_XDECREF( var_local_value );
438     var_local_value = NULL; 405     var_local_value = NULL;