Construct CallCompiledFunctionPosArgsDefaults

Performance Diagrams

Construct CallCompiledFunctionPosArgsDefaults 00100000001000000020000000200000003000000030000000400000004000000050000000500000006000000060000000700000007000000080000000800000009000000090000000100000000100000000110000000110000000120000000120000000130000000130000000140000000140000000150000000150000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)15252790088.11538461538461257.0CPython 2.743650000240.03846153846155433.3966076672883Nuitka (master)43650000391.96153846153845433.3966076672883Nuitka (develop)43650000543.8846153846154433.3966076672883Nuitka (factory)Construct CallCompiledFunctionPosArgsDefaultsTicks Construct CallCompiledFunctionPosArgsDefaults 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)16893822588.11538461538461257.0CPython 3.545000148240.03846153846155438.29115282433065Nuitka (master)45000148391.96153846153845438.29115282433065Nuitka (develop)45000148543.8846153846154438.29115282433065Nuitka (factory)Construct CallCompiledFunctionPosArgsDefaultsTicks

Source Code with Construct

from __future__ import print_function

def compiled_func(a = 1,b = 2,c = 3,d = 4,e = 5,f = 6):
    return a, b, c, d, e, f

def calledRepeatedly():
    # This is supposed to make a call to a compiled function, which is
    # being optimized separately.
    compiled_f = compiled_func

# construct_begin
    compiled_f()
    compiled_f()
    compiled_f()
# construct_alternative



    return compiled_f

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

print("OK.")

Source Code without Construct

from __future__ import print_function

def compiled_func(a = 1,b = 2,c = 3,d = 4,e = 5,f = 6):
    return a, b, c, d, e, f

def calledRepeatedly():
    # This is supposed to make a call to a compiled function, which is
    # being optimized separately.
    compiled_f = compiled_func

# construct_begin



# construct_alternative
    pass
# construct_end

    return compiled_f

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

print("OK.")

Context Diff of Source Code


Construct
Baseline
26     # This is supposed to make a call to a compiled function, which is 26     # This is supposed to make a call to a compiled function, which is
27     # being optimized separately. 27     # being optimized separately.
28     compiled_f = compiled_func 28     compiled_f = compiled_func
29 29
30 # construct_begin 30 # construct_begin
n 31     compiled_f() n
32     compiled_f()
33     compiled_f()
34 # construct_alternative
35 31
36 32
t t 33  
34 # construct_alternative
35     pass
36 # construct_end
37 37
38     return compiled_f 38     return compiled_f
39 39
40 import itertools 40 import itertools
41 for x in itertools.repeat(None, 50000): 41 for x in itertools.repeat(None, 50000):

Context Diff of Generated Code


Construct
Baseline
179     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; 179     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL;
180     PyObject *exception_type = NULL; 180     PyObject *exception_type = NULL;
181     PyObject *exception_value = NULL; 181     PyObject *exception_value = NULL;
182     PyTracebackObject *exception_tb = NULL; 182     PyTracebackObject *exception_tb = NULL;
183     NUITKA_MAY_BE_UNUSED int exception_lineno = 0; 183     NUITKA_MAY_BE_UNUSED int exception_lineno = 0;
n 184     NUITKA_MAY_BE_UNUSED nuitka_void tmp_unused; n
185     static struct Nuitka_FrameObject *cache_frame_c8590e9ea9520b2782de2b8f3e34ef24 = NULL; 184     static struct Nuitka_FrameObject *cache_frame_c8590e9ea9520b2782de2b8f3e34ef24 = NULL;
186     PyObject *tmp_return_value = NULL; 185     PyObject *tmp_return_value = NULL;
187     PyObject *exception_keeper_type_1; 186     PyObject *exception_keeper_type_1;
188     PyObject *exception_keeper_value_1; 187     PyObject *exception_keeper_value_1;
189     PyTracebackObject *exception_keeper_tb_1; 188     PyTracebackObject *exception_keeper_tb_1;
237             goto frame_exception_exit_1; 236             goto frame_exception_exit_1;
238         } 237         }
239         assert(var_compiled_f == NULL); 238         assert(var_compiled_f == NULL);
240         Py_INCREF(tmp_assign_source_1); 239         Py_INCREF(tmp_assign_source_1);
241         var_compiled_f = tmp_assign_source_1; 240         var_compiled_f = tmp_assign_source_1;
n 242     } n
243     {
244         PyObject *tmp_called_name_1;
245         PyObject *tmp_call_result_1;
246         CHECK_OBJECT(var_compiled_f);
247         tmp_called_name_1 = var_compiled_f;
248         frame_c8590e9ea9520b2782de2b8f3e34ef24->m_frame.f_lineno = 31;
249         tmp_call_result_1 = CALL_FUNCTION_NO_ARGS(tmp_called_name_1);
250         if (tmp_call_result_1 == NULL) {
251             assert(ERROR_OCCURRED());
252  
253             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
254  
255  
256             exception_lineno = 31;
257             type_description_1 = "o";
258             goto frame_exception_exit_1;
259         }
260         Py_DECREF(tmp_call_result_1);
261     }
262     {
263         PyObject *tmp_called_name_2;
264         PyObject *tmp_call_result_2;
265         CHECK_OBJECT(var_compiled_f);
266         tmp_called_name_2 = var_compiled_f;
267         frame_c8590e9ea9520b2782de2b8f3e34ef24->m_frame.f_lineno = 32;
268         tmp_call_result_2 = CALL_FUNCTION_NO_ARGS(tmp_called_name_2);
269         if (tmp_call_result_2 == NULL) {
270             assert(ERROR_OCCURRED());
271  
272             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
273  
274  
275             exception_lineno = 32;
276             type_description_1 = "o";
277             goto frame_exception_exit_1;
278         }
279         Py_DECREF(tmp_call_result_2);
280     }
281     {
282         PyObject *tmp_called_name_3;
283         PyObject *tmp_call_result_3;
284         CHECK_OBJECT(var_compiled_f);
285         tmp_called_name_3 = var_compiled_f;
286         frame_c8590e9ea9520b2782de2b8f3e34ef24->m_frame.f_lineno = 33;
287         tmp_call_result_3 = CALL_FUNCTION_NO_ARGS(tmp_called_name_3);
288         if (tmp_call_result_3 == NULL) {
289             assert(ERROR_OCCURRED());
290  
291             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
292  
293  
294             exception_lineno = 33;
295             type_description_1 = "o";
296             goto frame_exception_exit_1;
297         }
298         Py_DECREF(tmp_call_result_3);
299     } 241     }
300 242
301 #if 0 243 #if 0
302     RESTORE_FRAME_EXCEPTION(frame_c8590e9ea9520b2782de2b8f3e34ef24); 244     RESTORE_FRAME_EXCEPTION(frame_c8590e9ea9520b2782de2b8f3e34ef24);
303 #endif 245 #endif
368     exception_type = NULL; 310     exception_type = NULL;
369     exception_value = NULL; 311     exception_value = NULL;
370     exception_tb = NULL; 312     exception_tb = NULL;
371     exception_lineno = 0; 313     exception_lineno = 0;
372 314
t 373     Py_XDECREF(var_compiled_f); t
374     var_compiled_f = NULL;
375     // Re-raise. 315     // Re-raise.
376     exception_type = exception_keeper_type_1; 316     exception_type = exception_keeper_type_1;
377     exception_value = exception_keeper_value_1; 317     exception_value = exception_keeper_value_1;
378     exception_tb = exception_keeper_tb_1; 318     exception_tb = exception_keeper_tb_1;
379     exception_lineno = exception_keeper_lineno_1; 319     exception_lineno = exception_keeper_lineno_1;