Construct CallCompiledFunctionPosArgsDefaults

Performance Diagrams

Construct CallCompiledFunctionPosArgsDefaults 00100000001000000020000000200000003000000030000000400000004000000050000000500000006000000060000000700000007000000080000000800000009000000090000000100000000100000000110000000110000000120000000120000000130000000130000000140000000140000000150000000150000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)15177624188.11538461538461257.0CPython 2.742900000240.03846153846155434.26749584075094Nuitka (master)42900000391.96153846153845434.26749584075094Nuitka (develop)42900000543.8846153846154434.26749584075094Nuitka (factory)Construct CallCompiledFunctionPosArgsDefaultsTicks Construct CallCompiledFunctionPosArgsDefaults 00100000001000000020000000200000003000000030000000400000004000000050000000500000006000000060000000700000007000000080000000800000009000000090000000100000000100000000110000000110000000120000000120000000130000000130000000140000000140000000CPython 3.8Nuitka (master)Nuitka (develop)Nuitka (factory)14164352688.11538461538461257.00000000000006CPython 3.844700170240.03846153846155426.1301775687662Nuitka (master)44700170391.96153846153845426.1301775687662Nuitka (develop)44700170543.8846153846154426.1301775687662Nuitka (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
166     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; 166     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL;
167     PyObject *exception_type = NULL; 167     PyObject *exception_type = NULL;
168     PyObject *exception_value = NULL; 168     PyObject *exception_value = NULL;
169     PyTracebackObject *exception_tb = NULL; 169     PyTracebackObject *exception_tb = NULL;
170     NUITKA_MAY_BE_UNUSED int exception_lineno = 0; 170     NUITKA_MAY_BE_UNUSED int exception_lineno = 0;
n 171     NUITKA_MAY_BE_UNUSED nuitka_void tmp_unused; n
172     static struct Nuitka_FrameObject *cache_frame_e4923e9806ee824411da7fa2456f4250 = NULL; 171     static struct Nuitka_FrameObject *cache_frame_e4923e9806ee824411da7fa2456f4250 = NULL;
173     PyObject *tmp_return_value = NULL; 172     PyObject *tmp_return_value = NULL;
174     PyObject *exception_keeper_type_1; 173     PyObject *exception_keeper_type_1;
175     PyObject *exception_keeper_value_1; 174     PyObject *exception_keeper_value_1;
176     PyTracebackObject *exception_keeper_tb_1; 175     PyTracebackObject *exception_keeper_tb_1;
224             goto frame_exception_exit_1; 223             goto frame_exception_exit_1;
225         } 224         }
226         assert(var_compiled_f == NULL); 225         assert(var_compiled_f == NULL);
227         Py_INCREF(tmp_assign_source_1); 226         Py_INCREF(tmp_assign_source_1);
228         var_compiled_f = tmp_assign_source_1; 227         var_compiled_f = tmp_assign_source_1;
n 229     } n
230     {
231         PyObject *tmp_called_name_1;
232         PyObject *tmp_call_result_1;
233         CHECK_OBJECT(var_compiled_f);
234         tmp_called_name_1 = var_compiled_f;
235         frame_e4923e9806ee824411da7fa2456f4250->m_frame.f_lineno = 31;
236         tmp_call_result_1 = CALL_FUNCTION_NO_ARGS(tmp_called_name_1);
237         if (tmp_call_result_1 == NULL) {
238             assert(ERROR_OCCURRED());
239  
240             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
241  
242  
243             exception_lineno = 31;
244             type_description_1 = "o";
245             goto frame_exception_exit_1;
246         }
247         Py_DECREF(tmp_call_result_1);
248     }
249     {
250         PyObject *tmp_called_name_2;
251         PyObject *tmp_call_result_2;
252         CHECK_OBJECT(var_compiled_f);
253         tmp_called_name_2 = var_compiled_f;
254         frame_e4923e9806ee824411da7fa2456f4250->m_frame.f_lineno = 32;
255         tmp_call_result_2 = CALL_FUNCTION_NO_ARGS(tmp_called_name_2);
256         if (tmp_call_result_2 == NULL) {
257             assert(ERROR_OCCURRED());
258  
259             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
260  
261  
262             exception_lineno = 32;
263             type_description_1 = "o";
264             goto frame_exception_exit_1;
265         }
266         Py_DECREF(tmp_call_result_2);
267     }
268     {
269         PyObject *tmp_called_name_3;
270         PyObject *tmp_call_result_3;
271         CHECK_OBJECT(var_compiled_f);
272         tmp_called_name_3 = var_compiled_f;
273         frame_e4923e9806ee824411da7fa2456f4250->m_frame.f_lineno = 33;
274         tmp_call_result_3 = CALL_FUNCTION_NO_ARGS(tmp_called_name_3);
275         if (tmp_call_result_3 == NULL) {
276             assert(ERROR_OCCURRED());
277  
278             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
279  
280  
281             exception_lineno = 33;
282             type_description_1 = "o";
283             goto frame_exception_exit_1;
284         }
285         Py_DECREF(tmp_call_result_3);
286     } 228     }
287 229
288 #if 0 230 #if 0
289     RESTORE_FRAME_EXCEPTION(frame_e4923e9806ee824411da7fa2456f4250); 231     RESTORE_FRAME_EXCEPTION(frame_e4923e9806ee824411da7fa2456f4250);
290 #endif 232 #endif
355     exception_type = NULL; 297     exception_type = NULL;
356     exception_value = NULL; 298     exception_value = NULL;
357     exception_tb = NULL; 299     exception_tb = NULL;
358     exception_lineno = 0; 300     exception_lineno = 0;
359 301
t 360     Py_XDECREF(var_compiled_f); t
361     var_compiled_f = NULL;
362     // Re-raise. 302     // Re-raise.
363     exception_type = exception_keeper_type_1; 303     exception_type = exception_keeper_type_1;
364     exception_value = exception_keeper_value_1; 304     exception_value = exception_keeper_value_1;
365     exception_tb = exception_keeper_tb_1; 305     exception_tb = exception_keeper_tb_1;
366     exception_lineno = exception_keeper_lineno_1; 306     exception_lineno = exception_keeper_lineno_1;