Construct FunctionEmpty

Performance Diagrams

Construct FunctionEmpty 0020000002000000400000040000006000000600000080000008000000100000001000000012000000120000001400000014000000160000001600000018000000180000002000000020000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)2167979488.95192307692307257.0CPython 2.71950000242.31730769230768481.88846677658967Nuitka (master)1950000395.6826923076923481.88846677658967Nuitka (develop)2150000549.0480769230769479.6087828956876Nuitka (factory)Construct FunctionEmptyTicks Construct FunctionEmpty 002000000200000040000004000000600000060000008000000800000010000000100000001200000012000000140000001400000016000000160000001800000018000000200000002000000022000000220000002400000024000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)2486423288.95192307692307257.0CPython 3.52050000242.31730769230768483.74127700323163Nuitka (master)2050000395.6826923076923483.74127700323163Nuitka (develop)2050000549.0480769230769483.74127700323163Nuitka (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
91     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; 91     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL;
92     PyObject *exception_type = NULL; 92     PyObject *exception_type = NULL;
93     PyObject *exception_value = NULL; 93     PyObject *exception_value = NULL;
94     PyTracebackObject *exception_tb = NULL; 94     PyTracebackObject *exception_tb = NULL;
95     NUITKA_MAY_BE_UNUSED int exception_lineno = 0; 95     NUITKA_MAY_BE_UNUSED int exception_lineno = 0;
n 96     NUITKA_MAY_BE_UNUSED nuitka_void tmp_unused; n
97     static struct Nuitka_FrameObject *cache_frame_a795ba47839f1fa67af688d0fb08b789 = NULL; 96     static struct Nuitka_FrameObject *cache_frame_a795ba47839f1fa67af688d0fb08b789 = NULL;
98     PyObject *tmp_return_value = NULL; 97     PyObject *tmp_return_value = NULL;
99     PyObject *exception_keeper_type_1; 98     PyObject *exception_keeper_type_1;
100     PyObject *exception_keeper_value_1; 99     PyObject *exception_keeper_value_1;
101     PyTracebackObject *exception_keeper_tb_1; 100     PyTracebackObject *exception_keeper_tb_1;
152 151
153         tmp_assign_source_1 = tmp_mvar_value_1; 152         tmp_assign_source_1 = tmp_mvar_value_1;
154         assert(var_called == NULL); 153         assert(var_called == NULL);
155         Py_INCREF(tmp_assign_source_1); 154         Py_INCREF(tmp_assign_source_1);
156         var_called = tmp_assign_source_1; 155         var_called = tmp_assign_source_1;
n 157     } n
158     {
159         PyObject *tmp_called_name_1;
160         PyObject *tmp_call_result_1;
161         CHECK_OBJECT(var_called);
162         tmp_called_name_1 = var_called;
163         frame_a795ba47839f1fa67af688d0fb08b789->m_frame.f_lineno = 34;
164         tmp_call_result_1 = CALL_FUNCTION_NO_ARGS(tmp_called_name_1);
165         if (tmp_call_result_1 == NULL) {
166             assert(ERROR_OCCURRED());
167  
168             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
169  
170  
171             exception_lineno = 34;
172             type_description_1 = "o";
173             goto frame_exception_exit_1;
174         }
175         Py_DECREF(tmp_call_result_1);
176     } 156     }
177 157
178 #if 0 158 #if 0
179     RESTORE_FRAME_EXCEPTION(frame_a795ba47839f1fa67af688d0fb08b789); 159     RESTORE_FRAME_EXCEPTION(frame_a795ba47839f1fa67af688d0fb08b789);
180 #endif 160 #endif
244     exception_keeper_lineno_1 = exception_lineno; 224     exception_keeper_lineno_1 = exception_lineno;
245     exception_type = NULL; 225     exception_type = NULL;
246     exception_value = NULL; 226     exception_value = NULL;
247     exception_tb = NULL; 227     exception_tb = NULL;
248     exception_lineno = 0; 228     exception_lineno = 0;
t 249   t
250     Py_XDECREF(var_called);
251     var_called = NULL;
252 229
253     // Re-raise. 230     // Re-raise.
254     exception_type = exception_keeper_type_1; 231     exception_type = exception_keeper_type_1;
255     exception_value = exception_keeper_value_1; 232     exception_value = exception_keeper_value_1;
256     exception_tb = exception_keeper_tb_1; 233     exception_tb = exception_keeper_tb_1;