Construct RichComparisonStrings
Performance Diagrams
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); |