Construct OperationAttributeLookup

Performance Diagrams

Construct OperationAttributeLookup 001000000100000020000002000000300000030000004000000400000050000005000000600000060000007000000700000080000008000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)829878589.78846153846155257.0CPython 2.74975252244.59615384615387355.96582880227925Nuitka (master)4975012399.4038461538462355.9729753535283Nuitka (develop)4974712554.2115384615385355.9819085425896Nuitka (factory)Construct OperationAttributeLookupTicks Construct OperationAttributeLookup 001000000100000020000002000000300000030000004000000400000050000005000000600000060000007000000700000080000008000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)826650589.78846153846155257.0CPython 3.55200138244.59615384615387348.6646709312972Nuitka (master)5206178399.4038461538462348.4841137401896Nuitka (develop)5206610554.2115384615385348.47119971592497Nuitka (factory)Construct OperationAttributeLookupTicks

Source Code with Construct

module_value1 = list()
module_value2 = 3000

def calledRepeatedly():
    # Force frame and eliminate forward propagation (currently).
    module_value1

    local_value = module_value1

    s = module_value1
    s.append
# construct_begin
    s.append
# construct_end
    s.append

    return s, local_value

import itertools
for x in itertools.repeat(None, 25000):
    calledRepeatedly()

print("OK.")

Source Code without Construct

module_value1 = list()
module_value2 = 3000

def calledRepeatedly():
    # Force frame and eliminate forward propagation (currently).
    module_value1

    local_value = module_value1

    s = module_value1
    s.append
# construct_begin


    s.append

    return s, local_value

import itertools
for x in itertools.repeat(None, 25000):
    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     s.append 31     s.append
32 # construct_begin 32 # construct_begin
t 33     s.append t 33  
34 # construct_end 34  
35     s.append 35     s.append
36 36
37     return s, local_value 37     return s, local_value
38 38
39 import itertools 39 import itertools

Context Diff of Generated Code


Construct
Baseline
271         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "s" ); 271         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "s" );
272         exception_tb = NULL; 272         exception_tb = NULL;
273         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 273         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
274         CHAIN_EXCEPTION( exception_value ); 274         CHAIN_EXCEPTION( exception_value );
275 275
n 276         exception_lineno = 33; n 276         exception_lineno = 35;
277         type_description_1 = "oo"; 277         type_description_1 = "oo";
278         goto frame_exception_exit_1; 278         goto frame_exception_exit_1;
279     } 279     }
280 280
281     tmp_source_name_2 = var_s; 281     tmp_source_name_2 = var_s;
285         assert( ERROR_OCCURRED() ); 285         assert( ERROR_OCCURRED() );
286 286
287         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 287         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
288 288
289 289
n 290         exception_lineno = 33; n
291         type_description_1 = "oo";
292         goto frame_exception_exit_1;
293     }
294     Py_DECREF( tmp_attribute_value_2 );
295     }
296     {
297     PyObject *tmp_source_name_3;
298     PyObject *tmp_attribute_value_3;
299     if ( var_s == NULL )
300     {
301  
302         exception_type = PyExc_UnboundLocalError;
303         Py_INCREF( exception_type );
304         exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "s" );
305         exception_tb = NULL;
306         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
307         CHAIN_EXCEPTION( exception_value );
308  
309         exception_lineno = 35; 290         exception_lineno = 35;
310         type_description_1 = "oo"; 291         type_description_1 = "oo";
311         goto frame_exception_exit_1; 292         goto frame_exception_exit_1;
312     } 293     }
t 313   t
314     tmp_source_name_3 = var_s;
315     tmp_attribute_value_3 = LOOKUP_ATTRIBUTE( tmp_source_name_3, const_str_plain_append );
316     if ( tmp_attribute_value_3 == NULL )
317     {
318         assert( ERROR_OCCURRED() );
319  
320         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
321  
322  
323         exception_lineno = 35;
324         type_description_1 = "oo";
325         goto frame_exception_exit_1;
326     }
327     Py_DECREF( tmp_attribute_value_3 ); 294     Py_DECREF( tmp_attribute_value_2 );
328     } 295     }
329     { 296     {
330     PyObject *tmp_tuple_element_1; 297     PyObject *tmp_tuple_element_1;
331     if ( var_s == NULL ) 298     if ( var_s == NULL )
332     { 299     {