Construct BuiltinSumWithTuple

Performance Diagrams

Construct BuiltinSumWithTuple 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000180000001800000020000000200000002200000022000000240000002400000026000000260000002800000028000000CPython 3.10Nuitka (main)Nuitka (develop)Nuitka (factory)2819916888.95192307692307257.0CPython 3.1020200000242.31730769230768327.09843258223356Nuitka (main)20200000395.6826923076923327.09843258223356Nuitka (develop)20200000549.0480769230769327.09843258223356Nuitka (factory)Construct BuiltinSumWithTupleTicks Construct BuiltinSumWithTuple 0020000002000000400000040000006000000600000080000008000000100000001000000012000000120000001400000014000000160000001600000018000000180000002000000020000000220000002200000024000000240000002600000026000000CPython 3.8Nuitka (main)Nuitka (develop)Nuitka (factory)2669911388.95192307692307257.0CPython 3.820200000242.31730769230768317.1529649563207Nuitka (main)20200000395.6826923076923317.1529649563207Nuitka (develop)20200000549.0480769230769317.1529649563207Nuitka (factory)Construct BuiltinSumWithTupleTicks Construct BuiltinSumWithTuple 0020000002000000400000040000006000000600000080000008000000100000001000000012000000120000001400000014000000160000001600000018000000180000002000000020000000CPython 2.7Nuitka (main)Nuitka (develop)Nuitka (factory)1399871688.95192307692307335.3691363977486CPython 2.720500000242.31730769230768257.0Nuitka (main)20500000395.6826923076923257.0Nuitka (develop)20500000549.0480769230769257.0Nuitka (factory)Construct BuiltinSumWithTupleTicks

Source Code with Construct

    return x, y


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

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

    y = sum(empty)
    # construct_end

    return x, y


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

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     value 13     value
14 14
15     # We measure making a tuple iterator step or not. 15     # We measure making a tuple iterator step or not.
16 16
17     # construct_begin 17     # construct_begin
n 18     y = sum(iterable) n 18  
19     # construct_alternative 19     # construct_alternative
t 20   t 20     y = sum(empty)
21   21     # construct_end
22 22
23     return x, y 23     return x, y
24 24
25 25
26 for x in itertools.repeat(None, 50000): 26 for x in itertools.repeat(None, 50000):

Context Diff of Generated Code


Construct
Baseline
168         } 168         }
169     } 169     }
170     { 170     {
171         PyObject *tmp_assign_source_1; 171         PyObject *tmp_assign_source_1;
172         PyObject *tmp_sum_sequence_1; 172         PyObject *tmp_sum_sequence_1;
n 173         CHECK_OBJECT(par_iterable); n 173         CHECK_OBJECT(par_empty);
174         tmp_sum_sequence_1 = par_iterable; 174         tmp_sum_sequence_1 = par_empty;
175         tmp_assign_source_1 = BUILTIN_SUM1(tstate, tmp_sum_sequence_1); 175         tmp_assign_source_1 = BUILTIN_SUM1(tstate, tmp_sum_sequence_1);
176         if (tmp_assign_source_1 == NULL) { 176         if (tmp_assign_source_1 == NULL) {
177             assert(HAS_ERROR_OCCURRED(tstate)); 177             assert(HAS_ERROR_OCCURRED(tstate));
178 178
179             FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb); 179             FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb);
180 180
181 181
t 182             exception_lineno = 18; t 182             exception_lineno = 20;
183             type_description_1 = "ooo"; 183             type_description_1 = "ooo";
184             goto frame_exception_exit_1; 184             goto frame_exception_exit_1;
185         } 185         }
186         assert(var_y == NULL); 186         assert(var_y == NULL);
187         var_y = tmp_assign_source_1; 187         var_y = tmp_assign_source_1;