Construct BuiltinSumWithList

Performance Diagrams

Construct BuiltinSumWithList 002000000200000040000004000000600000060000008000000800000010000000100000001200000012000000140000001400000016000000160000001800000018000000200000002000000022000000220000002400000024000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)1499910888.95192307692307350.9538002225048CPython 2.712200000242.31730769230768379.53655435473615Nuitka (master)24200000395.6826923076923257.0Nuitka (develop)24200000549.0480769230769257.0Nuitka (factory)Construct BuiltinSumWithListTicks Construct BuiltinSumWithList 00200000020000004000000400000060000006000000800000080000001000000010000000120000001200000014000000140000001600000016000000180000001800000020000000200000002200000022000000240000002400000026000000260000002800000028000000CPython 3.8Nuitka (master)Nuitka (develop)Nuitka (factory)2934947088.95192307692307257.0CPython 3.822550875242.31730769230768314.2425130085562Nuitka (master)22550867395.6826923076923314.2425803666066Nuitka (develop)22550867549.0480769230769314.2425803666066Nuitka (factory)Construct BuiltinSumWithListTicks

Source Code with Construct

empty = ()

value = list(range(10))

def calledRepeatedly(iterable, empty):
    # Force frame
    value

    # We measure making a list iterator step or not.

# construct_begin
    y = sum(iterable)
# construct_alternative



    return x, y

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

print("OK.")

Source Code without Construct

empty = ()

value = list(range(10))

def calledRepeatedly(iterable, empty):
    # Force frame
    value

    # We measure making a list iterator step or not.

# construct_begin

# construct_alternative
    y = sum(empty)
# construct_end

    return x, y

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

print("OK.")

Context Diff of Source Code


Construct
Baseline
27     value 27     value
28 28
29     # We measure making a list iterator step or not. 29     # We measure making a list iterator step or not.
30 30
31 # construct_begin 31 # construct_begin
n 32     y = sum(iterable) n 32  
33 # construct_alternative 33 # construct_alternative
t 34   t 34     y = sum(empty)
35   35 # construct_end
36 36
37     return x, y 37     return x, y
38 38
39 import itertools 39 import itertools
40 for x in itertools.repeat(None, 50000): 40 for x in itertools.repeat(None, 50000):

Context Diff of Generated Code


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