Construct FunctionEmpty

Performance Diagrams

Construct FunctionEmpty 0020000002000000400000040000006000000600000080000008000000100000001000000012000000120000001400000014000000160000001600000018000000180000002000000020000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)2167968688.95192307692307257.0CPython 2.72150000242.31730769230768479.60866081306216Nuitka (master)2400000395.6826923076923476.75904176628046Nuitka (develop)2400000549.0480769230769476.75904176628046Nuitka (factory)Construct FunctionEmptyTicks Construct FunctionEmpty 002000000200000040000004000000600000060000008000000800000010000000100000001200000012000000140000001400000016000000160000001800000018000000200000002000000022000000220000002400000024000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)2486420688.95192307692307257.0CPython 3.52050000242.31730769230768483.74125569843716Nuitka (master)2400000395.6826923076923480.26274588334854Nuitka (develop)2400000549.0480769230769480.26274588334854Nuitka (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_5a6f5750425a1d9e90073f1c2ce4b9ca = NULL; 96     static struct Nuitka_FrameObject *cache_frame_5a6f5750425a1d9e90073f1c2ce4b9ca = 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;
144             goto frame_exception_exit_1; 143             goto frame_exception_exit_1;
145         } 144         }
146         assert(var_called == NULL); 145         assert(var_called == NULL);
147         Py_INCREF(tmp_assign_source_1); 146         Py_INCREF(tmp_assign_source_1);
148         var_called = tmp_assign_source_1; 147         var_called = tmp_assign_source_1;
n 149     } n
150     {
151         PyObject *tmp_called_name_1;
152         PyObject *tmp_call_result_1;
153         CHECK_OBJECT(var_called);
154         tmp_called_name_1 = var_called;
155         frame_5a6f5750425a1d9e90073f1c2ce4b9ca->m_frame.f_lineno = 34;
156         tmp_call_result_1 = CALL_FUNCTION_NO_ARGS(tmp_called_name_1);
157         if (tmp_call_result_1 == NULL) {
158             assert(ERROR_OCCURRED());
159  
160             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
161  
162  
163             exception_lineno = 34;
164             type_description_1 = "o";
165             goto frame_exception_exit_1;
166         }
167         Py_DECREF(tmp_call_result_1);
168     } 148     }
169 149
170 #if 0 150 #if 0
171     RESTORE_FRAME_EXCEPTION(frame_5a6f5750425a1d9e90073f1c2ce4b9ca); 151     RESTORE_FRAME_EXCEPTION(frame_5a6f5750425a1d9e90073f1c2ce4b9ca);
172 #endif 152 #endif
236     exception_type = NULL; 216     exception_type = NULL;
237     exception_value = NULL; 217     exception_value = NULL;
238     exception_tb = NULL; 218     exception_tb = NULL;
239     exception_lineno = 0; 219     exception_lineno = 0;
240 220
t 241     Py_XDECREF(var_called); t
242     var_called = NULL;
243     // Re-raise. 221     // Re-raise.
244     exception_type = exception_keeper_type_1; 222     exception_type = exception_keeper_type_1;
245     exception_value = exception_keeper_value_1; 223     exception_value = exception_keeper_value_1;
246     exception_tb = exception_keeper_tb_1; 224     exception_tb = exception_keeper_tb_1;
247     exception_lineno = exception_keeper_lineno_1; 225     exception_lineno = exception_keeper_lineno_1;