Construct FunctionEmpty

Performance Diagrams

Construct FunctionEmpty 0020000002000000400000040000006000000600000080000008000000100000001000000012000000120000001400000014000000160000001600000018000000180000002000000020000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)2167965188.95192307692307257.0CPython 2.71950000242.31730769230768481.8883201667918Nuitka (master)1950000395.6826923076923481.8883201667918Nuitka (develop)1950000549.0480769230769481.8883201667918Nuitka (factory)Construct FunctionEmptyTicks Construct FunctionEmpty 002000000200000040000004000000600000060000008000000800000010000000100000001200000012000000140000001400000016000000160000001800000018000000200000002000000022000000220000002400000024000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)2486421488.95192307692307257.0CPython 3.52050000242.31730769230768483.7412622537633Nuitka (master)2050000395.6826923076923483.7412622537633Nuitka (develop)2050000549.0480769230769483.7412622537633Nuitka (factory)Construct FunctionEmptyTicks

Source Code with Construct

def empty():
    pass

module_var = None

def calledRepeatedly():
    # We measure making that call or not. Lets get the module
    # variable look-up out of the game, by making it a local
    # variable
    called = empty

# construct_begin
    called()
# construct_end

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

print("OK.")

Source Code without Construct

def empty():
    pass

module_var = None

def calledRepeatedly():
    # We measure making that call or not. Lets get the module
    # variable look-up out of the game, by making it a local
    # variable
    called = empty

# construct_begin



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

print("OK.")

Context Diff of Source Code


Construct
Baseline
29     # variable look-up out of the game, by making it a local 29     # variable look-up out of the game, by making it a local
30     # variable 30     # variable
31     called = empty 31     called = empty
32 32
33 # construct_begin 33 # construct_begin
t 34     called() t 34  
35 # construct_end 35  
36 36
37 import itertools 37 import itertools
38 for x in itertools.repeat(None, 50000): 38 for x in itertools.repeat(None, 50000):
39     calledRepeatedly() 39     calledRepeatedly()
40 40

Context Diff of Generated Code


Construct
Baseline
123     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; 123     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL;
124     PyObject *exception_type = NULL; 124     PyObject *exception_type = NULL;
125     PyObject *exception_value = NULL; 125     PyObject *exception_value = NULL;
126     PyTracebackObject *exception_tb = NULL; 126     PyTracebackObject *exception_tb = NULL;
127     NUITKA_MAY_BE_UNUSED int exception_lineno = 0; 127     NUITKA_MAY_BE_UNUSED int exception_lineno = 0;
n 128     NUITKA_MAY_BE_UNUSED nuitka_void tmp_unused; n
129     static struct Nuitka_FrameObject *cache_frame_00c8e1934337a71cea2a8193e26dd8bd = NULL; 128     static struct Nuitka_FrameObject *cache_frame_00c8e1934337a71cea2a8193e26dd8bd = NULL;
130     PyObject *tmp_return_value = NULL; 129     PyObject *tmp_return_value = NULL;
131     PyObject *exception_keeper_type_1; 130     PyObject *exception_keeper_type_1;
132     PyObject *exception_keeper_value_1; 131     PyObject *exception_keeper_value_1;
133     PyTracebackObject *exception_keeper_tb_1; 132     PyTracebackObject *exception_keeper_tb_1;
187 186
188         tmp_assign_source_1 = tmp_mvar_value_1; 187         tmp_assign_source_1 = tmp_mvar_value_1;
189         assert(var_called == NULL); 188         assert(var_called == NULL);
190         Py_INCREF(tmp_assign_source_1); 189         Py_INCREF(tmp_assign_source_1);
191         var_called = tmp_assign_source_1; 190         var_called = tmp_assign_source_1;
n 192     } n
193     {
194         PyObject *tmp_called_name_1;
195         PyObject *tmp_call_result_1;
196         CHECK_OBJECT(var_called);
197         tmp_called_name_1 = var_called;
198         frame_00c8e1934337a71cea2a8193e26dd8bd->m_frame.f_lineno = 34;
199         tmp_call_result_1 = CALL_FUNCTION_NO_ARGS(tmp_called_name_1);
200         if (tmp_call_result_1 == NULL) {
201             assert(ERROR_OCCURRED());
202  
203             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
204  
205  
206             exception_lineno = 34;
207             type_description_1 = "o";
208             goto frame_exception_exit_1;
209         }
210         Py_DECREF(tmp_call_result_1);
211     } 191     }
212 192
213 #if 0 193 #if 0
214     RESTORE_FRAME_EXCEPTION(frame_00c8e1934337a71cea2a8193e26dd8bd); 194     RESTORE_FRAME_EXCEPTION(frame_00c8e1934337a71cea2a8193e26dd8bd);
215 #endif 195 #endif
279     exception_keeper_lineno_1 = exception_lineno; 259     exception_keeper_lineno_1 = exception_lineno;
280     exception_type = NULL; 260     exception_type = NULL;
281     exception_value = NULL; 261     exception_value = NULL;
282     exception_tb = NULL; 262     exception_tb = NULL;
283     exception_lineno = 0; 263     exception_lineno = 0;
t 284   t
285     Py_XDECREF(var_called);
286     var_called = NULL;
287 264
288     // Re-raise. 265     // Re-raise.
289     exception_type = exception_keeper_type_1; 266     exception_type = exception_keeper_type_1;
290     exception_value = exception_keeper_value_1; 267     exception_value = exception_keeper_value_1;
291     exception_tb = exception_keeper_tb_1; 268     exception_tb = exception_keeper_tb_1;