Construct BuiltinSumWithGenerator

Performance Diagrams

Construct BuiltinSumWithGenerator 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000200000000200000000220000000220000000CPython 3.10Nuitka (main)Nuitka (develop)Nuitka (factory)22954527188.11538461538461257.0CPython 3.10147596350240.03846153846155345.22154794785894Nuitka (main)147596350391.96153846153845345.22154794785894Nuitka (develop)147596350543.8846153846154345.22154794785894Nuitka (factory)Construct BuiltinSumWithGeneratorTicks Construct BuiltinSumWithGenerator 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000200000000200000000220000000220000000CPython 3.8Nuitka (main)Nuitka (develop)Nuitka (factory)23115743788.11538461538461257.0CPython 3.8149944217240.03846153846155343.81977251787Nuitka (main)149944217391.96153846153845343.81977251787Nuitka (develop)149944205543.8846153846154343.8197853462896Nuitka (factory)Construct BuiltinSumWithGeneratorTicks Construct BuiltinSumWithGenerator 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000CPython 2.7Nuitka (main)Nuitka (develop)Nuitka (factory)16666775688.11538461538461257.0CPython 2.7121063046240.03846153846155324.6173107647953Nuitka (main)121063046391.96153846153845324.6173107647953Nuitka (develop)121063046543.8846153846154324.6173107647953Nuitka (factory)Construct BuiltinSumWithGeneratorTicks

Source Code with Construct

    return y


for x in itertools.repeat(None, 500):
    calledRepeatedly((x for x in range(1000)), 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

    return y


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

Context Diff of Generated Code


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