Construct GeneratorExpressionUsage

Performance Diagrams

Construct GeneratorExpressionUsage 00100000001000000020000000200000003000000030000000400000004000000050000000500000006000000060000000700000007000000080000000800000009000000090000000100000000100000000110000000110000000120000000120000000130000000130000000140000000140000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)14847242688.11538461538461257.00000000000006CPython 2.792721205240.03846153846155349.7915357171595Nuitka (master)92721205391.96153846153845349.7915357171595Nuitka (develop)92671210543.8846153846154349.87474668088305Nuitka (factory)Construct GeneratorExpressionUsageTicks Construct GeneratorExpressionUsage 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)19462597388.11538461538461257.0CPython 3.585346563240.03846153846155395.75138562668775Nuitka (master)86146740391.96153846153845394.73540587810925Nuitka (develop)86146757543.8846153846154394.73538429331524Nuitka (factory)Construct GeneratorExpressionUsageTicks

Source Code with Construct

not_all = [1,1,1,1,1,1,1,1,0,1]

def calledRepeatedly():
    # We measure making a generator iterator step or not.
    gen = (x for x in not_all)

    # make sure it is started.
    x = next(gen)

    # This should abort.
# construct_begin
    all(gen)
# construct_end

    # make sure it is still running.
    y = next(gen)

    return x, y

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

print("OK.")

Source Code without Construct

not_all = [1,1,1,1,1,1,1,1,0,1]

def calledRepeatedly():
    # We measure making a generator iterator step or not.
    gen = (x for x in not_all)

    # make sure it is started.
    x = next(gen)

    # This should abort.
# construct_begin



    # make sure it is still running.
    y = next(gen)

    return x, y

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

print("OK.")

Context Diff of Source Code


Construct
Baseline
27     # make sure it is started. 27     # make sure it is started.
28     x = next(gen) 28     x = next(gen)
29 29
30     # This should abort. 30     # This should abort.
31 # construct_begin 31 # construct_begin
t 32     all(gen) t 32  
33 # construct_end 33  
34 34
35     # make sure it is still running. 35     # make sure it is still running.
36     y = next(gen) 36     y = next(gen)
37 37
38     return x, y 38     return x, y

Context Diff of Generated Code


Construct
Baseline
94     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; 94     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL;
95     PyObject *exception_type = NULL; 95     PyObject *exception_type = NULL;
96     PyObject *exception_value = NULL; 96     PyObject *exception_value = NULL;
97     PyTracebackObject *exception_tb = NULL; 97     PyTracebackObject *exception_tb = NULL;
98     NUITKA_MAY_BE_UNUSED int exception_lineno = 0; 98     NUITKA_MAY_BE_UNUSED int exception_lineno = 0;
n 99     NUITKA_MAY_BE_UNUSED nuitka_void tmp_unused; n
100     static struct Nuitka_FrameObject *cache_frame_713c606b19fd610e92d439bc951f7aec = NULL; 99     static struct Nuitka_FrameObject *cache_frame_713c606b19fd610e92d439bc951f7aec = NULL;
101     PyObject *tmp_return_value = NULL; 100     PyObject *tmp_return_value = NULL;
102     PyObject *exception_keeper_type_1; 101     PyObject *exception_keeper_type_1;
103     PyObject *exception_keeper_value_1; 102     PyObject *exception_keeper_value_1;
104     PyTracebackObject *exception_keeper_tb_1; 103     PyTracebackObject *exception_keeper_tb_1;
222             exception_lineno = 28; 221             exception_lineno = 28;
223             goto frame_exception_exit_1; 222             goto frame_exception_exit_1;
224         } 223         }
225         assert(var_x == NULL); 224         assert(var_x == NULL);
226         var_x = tmp_assign_source_3; 225         var_x = tmp_assign_source_3;
t 227     } t
228     {
229         PyObject *tmp_all_arg_1;
230         PyObject *tmp_capi_result_1;
231         CHECK_OBJECT(var_gen);
232         tmp_all_arg_1 = var_gen;
233         tmp_capi_result_1 = BUILTIN_ALL(tmp_all_arg_1);
234         if (tmp_capi_result_1 == NULL) {
235             assert(ERROR_OCCURRED());
236  
237             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
238  
239  
240             exception_lineno = 32;
241             type_description_1 = "ooo";
242             goto frame_exception_exit_1;
243         }
244         Py_DECREF(tmp_capi_result_1);
245     } 226     }
246     { 227     {
247         PyObject *tmp_assign_source_4; 228         PyObject *tmp_assign_source_4;
248         PyObject *tmp_value_name_2; 229         PyObject *tmp_value_name_2;
249         CHECK_OBJECT(var_gen); 230         CHECK_OBJECT(var_gen);