Construct RichComparisonStrings

Performance Diagrams

Construct RichComparisonStrings 00100000010000002000000200000030000003000000400000040000005000000500000060000006000000700000070000008000000800000090000009000000100000001000000011000000110000001200000012000000CPython 3.10Nuitka (main)Nuitka (develop)Nuitka (factory)1219815488.95192307692307257.0CPython 3.107150013242.31730769230768359.2673844589675Nuitka (main)7149984395.6826923076923359.2679719532846Nuitka (develop)7150262549.0480769230769359.2623401112105Nuitka (factory)Construct RichComparisonStringsTicks Construct RichComparisonStrings 00100000010000002000000200000030000003000000400000040000005000000500000060000006000000700000070000008000000800000090000009000000100000001000000011000000110000001200000012000000CPython 3.8Nuitka (main)Nuitka (develop)Nuitka (factory)1218040288.95192307692307257.0CPython 3.87100134242.31730769230768360.06822227782226Nuitka (main)7099948395.6826923076923360.0719958364896Nuitka (develop)7100008549.0480769230769360.0707785595001Nuitka (factory)Construct RichComparisonStringsTicks Construct RichComparisonStrings 001000000100000020000002000000300000030000004000000400000050000005000000600000060000007000000700000080000008000000900000090000001000000010000000CPython 2.7Nuitka (main)Nuitka (develop)Nuitka (factory)1073623088.95192307692307257.0CPython 2.74550000242.31730769230768399.3882131594825Nuitka (main)4550000395.6826923076923399.3882131594825Nuitka (develop)4550000549.0480769230769399.3882131594825Nuitka (factory)Construct RichComparisonStringsTicks

Source Code with Construct

    # construct_end

    return value1, value2


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

print("OK.")

#     Python test originally created or extracted from other peoples work. The
#     parts from me are licensed as below. It is at least Free Software where
#     it's copied from other people. In these cases, that will normally be
#     indicated.
#
#     Licensed under the Apache License, Version 2.0 (the "License");
#     you may not use this file except in compliance with the License.
#     You may obtain a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#     Unless required by applicable law or agreed to in writing, software
#     distributed under the License is distributed on an "AS IS" BASIS,
#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#     See the License for the specific language governing permissions and
#     limitations under the License.

Source Code without Construct

    return value1, value2


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

print("OK.")

#     Python test originally created or extracted from other peoples work. The
#     parts from me are licensed as below. It is at least Free Software where
#     it's copied from other people. In these cases, that will normally be
#     indicated.
#
#     Licensed under the Apache License, Version 2.0 (the "License");
#     you may not use this file except in compliance with the License.
#     You may obtain a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#     Unless required by applicable law or agreed to in writing, software
#     distributed under the License is distributed on an "AS IS" BASIS,
#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#     See the License for the specific language governing permissions and
#     limitations under the License.

Context Diff of Source Code


Construct
Baseline
13 def calledRepeatedly(value1, value2): 13 def calledRepeatedly(value1, value2):
14     # Force frame and eliminate forward propagation (currently). 14     # Force frame and eliminate forward propagation (currently).
15     module_value1 15     module_value1
16 16
17     # construct_begin 17     # construct_begin
t 18     if value1 == value2: t 18  
19         return 19  
20     # construct_end 20  
21 21
22     return value1, value2 22     return value1, value2
23 23
24 24
25 for x in itertools.repeat(None, 50000): 25 for x in itertools.repeat(None, 50000):

Context Diff of Generated Code


Construct
Baseline
109     NUITKA_MAY_BE_UNUSED nuitka_void tmp_unused; 109     NUITKA_MAY_BE_UNUSED nuitka_void tmp_unused;
110     PyObject *exception_type = NULL; 110     PyObject *exception_type = NULL;
111     PyObject *exception_value = NULL; 111     PyObject *exception_value = NULL;
112     PyTracebackObject *exception_tb = NULL; 112     PyTracebackObject *exception_tb = NULL;
113     NUITKA_MAY_BE_UNUSED int exception_lineno = 0; 113     NUITKA_MAY_BE_UNUSED int exception_lineno = 0;
n n 114     static struct Nuitka_FrameObject *cache_frame_7af3c5595c609f87027368b58147d682 = NULL;
114     PyObject *tmp_return_value = NULL; 115     PyObject *tmp_return_value = NULL;
n 115     static struct Nuitka_FrameObject *cache_frame_7af3c5595c609f87027368b58147d682 = NULL; n
116 116
117     // Actual function body. 117     // Actual function body.
118     if (isFrameUnusable(cache_frame_7af3c5595c609f87027368b58147d682)) { 118     if (isFrameUnusable(cache_frame_7af3c5595c609f87027368b58147d682)) {
119         Py_XDECREF(cache_frame_7af3c5595c609f87027368b58147d682); 119         Py_XDECREF(cache_frame_7af3c5595c609f87027368b58147d682);
120 120
159             exception_lineno = 15; 159             exception_lineno = 15;
160             type_description_1 = "oo"; 160             type_description_1 = "oo";
161             goto frame_exception_exit_1; 161             goto frame_exception_exit_1;
162         } 162         }
163     } 163     }
n 164     { n
165         nuitka_bool tmp_condition_result_1;
166         PyObject *tmp_cmp_expr_left_1;
167         PyObject *tmp_cmp_expr_right_1;
168         CHECK_OBJECT(par_value1);
169         tmp_cmp_expr_left_1 = par_value1;
170         CHECK_OBJECT(par_value2);
171         tmp_cmp_expr_right_1 = par_value2;
172         tmp_condition_result_1 = RICH_COMPARE_EQ_NBOOL_OBJECT_OBJECT(tmp_cmp_expr_left_1, tmp_cmp_expr_right_1);
173         if (tmp_condition_result_1 == NUITKA_BOOL_EXCEPTION) {
174             assert(HAS_ERROR_OCCURRED(tstate));
175  
176             FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb);
177  
178  
179             exception_lineno = 18;
180             type_description_1 = "oo";
181             goto frame_exception_exit_1;
182         }
183         if (tmp_condition_result_1 == NUITKA_BOOL_TRUE) {
184             goto branch_yes_1;
185         } else {
186             goto branch_no_1;
187         }
188     }
189     branch_yes_1:;
190     tmp_return_value = Py_None;
191     Py_INCREF(tmp_return_value);
192     goto frame_return_exit_1;
193     branch_no_1:;
194 164
195 165
196     // Put the previous frame back on top. 166     // Put the previous frame back on top.
197     popFrameStack(tstate); 167     popFrameStack(tstate);
198 168
199     goto frame_no_exception_1; 169     goto frame_no_exception_1;
t 200     frame_return_exit_1: t
201  
202     // Put the previous frame back on top.
203     popFrameStack(tstate);
204  
205     goto function_return_exit;
206     frame_exception_exit_1: 170     frame_exception_exit_1:
207 171
208 172
209     if (exception_tb == NULL) { 173     if (exception_tb == NULL) {
210         exception_tb = MAKE_TRACEBACK(frame_7af3c5595c609f87027368b58147d682, exception_lineno); 174         exception_tb = MAKE_TRACEBACK(frame_7af3c5595c609f87027368b58147d682, exception_lineno);