Construct CallCompiledFunctionPosArgsDefaults

Performance Diagrams

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