Construct CallCompiledFunctionPosArgsVariable

Performance Diagrams

Construct CallCompiledFunctionPosArgsVariable 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)17710471488.11538461538461257.0CPython 2.742152269240.03846153846155445.30004350398906Nuitka (master)44947346391.96153846153845441.40005398770427Nuitka (develop)44947346543.8846153846154441.40005398770427Nuitka (factory)Construct CallCompiledFunctionPosArgsVariableTicks Construct CallCompiledFunctionPosArgsVariable 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000CPython 3.8Nuitka (master)Nuitka (develop)Nuitka (factory)16385982988.11538461538461257.0CPython 3.844203825240.03846153846155437.4520340979973Nuitka (master)44202018391.96153846153845437.4547592167938Nuitka (develop)44200000543.8846153846154437.4578025425997Nuitka (factory)Construct CallCompiledFunctionPosArgsVariableTicks

Source Code with Construct

from __future__ import print_function

def compiled_func(a,b,c,d,e,f):
    return a, b, c, d, e, f

def getUnknownValue():
    return 8

def calledRepeatedly():
    a = getUnknownValue()
    b = getUnknownValue()
    c = getUnknownValue()
    d = getUnknownValue()
    e = getUnknownValue()
    f = getUnknownValue()

    compiled_f = compiled_func

    # This is supposed to make a call to a compiled function, which is
    # being optimized separately.
# construct_begin
    compiled_f(a, b, c, d, e, f)
    compiled_f(a, c, b, d, e, f)
    compiled_f(a, b, c, d, f, e)
# construct_alternative



    return compiled_f

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

print("OK.")

Source Code without Construct

from __future__ import print_function

def compiled_func(a,b,c,d,e,f):
    return a, b, c, d, e, f

def getUnknownValue():
    return 8

def calledRepeatedly():
    a = getUnknownValue()
    b = getUnknownValue()
    c = getUnknownValue()
    d = getUnknownValue()
    e = getUnknownValue()
    f = getUnknownValue()

    compiled_f = compiled_func

    # This is supposed to make a call to a compiled function, which is
    # being optimized separately.
# construct_begin



# construct_alternative
    pass
# construct_end

    return compiled_f

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

print("OK.")

Context Diff of Source Code


Construct
Baseline
36     compiled_f = compiled_func 36     compiled_f = compiled_func
37 37
38     # This is supposed to make a call to a compiled function, which is 38     # This is supposed to make a call to a compiled function, which is
39     # being optimized separately. 39     # being optimized separately.
40 # construct_begin 40 # construct_begin
n 41     compiled_f(a, b, c, d, e, f) n
42     compiled_f(a, c, b, d, e, f)
43     compiled_f(a, b, c, d, f, e)
44 # construct_alternative
45 41
46 42
t t 43  
44 # construct_alternative
45     pass
46 # construct_end
47 47
48     return compiled_f 48     return compiled_f
49 49
50 import itertools 50 import itertools
51 for x in itertools.repeat(None, 50000): 51 for x in itertools.repeat(None, 50000):

Context Diff of Generated Code


Construct
Baseline
189     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; 189     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL;
190     PyObject *exception_type = NULL; 190     PyObject *exception_type = NULL;
191     PyObject *exception_value = NULL; 191     PyObject *exception_value = NULL;
192     PyTracebackObject *exception_tb = NULL; 192     PyTracebackObject *exception_tb = NULL;
193     NUITKA_MAY_BE_UNUSED int exception_lineno = 0; 193     NUITKA_MAY_BE_UNUSED int exception_lineno = 0;
n 194     NUITKA_MAY_BE_UNUSED nuitka_void tmp_unused; n
195     static struct Nuitka_FrameObject *cache_frame_4310f20717829bd2bbbe58e393dc7abd = NULL; 194     static struct Nuitka_FrameObject *cache_frame_4310f20717829bd2bbbe58e393dc7abd = NULL;
196     PyObject *tmp_return_value = NULL; 195     PyObject *tmp_return_value = NULL;
197     PyObject *exception_keeper_type_1; 196     PyObject *exception_keeper_type_1;
198     PyObject *exception_keeper_value_1; 197     PyObject *exception_keeper_value_1;
199     PyTracebackObject *exception_keeper_tb_1; 198     PyTracebackObject *exception_keeper_tb_1;
451             goto frame_exception_exit_1; 450             goto frame_exception_exit_1;
452         } 451         }
453         assert(var_compiled_f == NULL); 452         assert(var_compiled_f == NULL);
454         Py_INCREF(tmp_assign_source_7); 453         Py_INCREF(tmp_assign_source_7);
455         var_compiled_f = tmp_assign_source_7; 454         var_compiled_f = tmp_assign_source_7;
n 456     } n
457     {
458         PyObject *tmp_called_name_7;
459         PyObject *tmp_call_result_1;
460         PyObject *tmp_args_element_name_1;
461         PyObject *tmp_args_element_name_2;
462         PyObject *tmp_args_element_name_3;
463         PyObject *tmp_args_element_name_4;
464         PyObject *tmp_args_element_name_5;
465         PyObject *tmp_args_element_name_6;
466         CHECK_OBJECT(var_compiled_f);
467         tmp_called_name_7 = var_compiled_f;
468         CHECK_OBJECT(var_a);
469         tmp_args_element_name_1 = var_a;
470         CHECK_OBJECT(var_b);
471         tmp_args_element_name_2 = var_b;
472         CHECK_OBJECT(var_c);
473         tmp_args_element_name_3 = var_c;
474         CHECK_OBJECT(var_d);
475         tmp_args_element_name_4 = var_d;
476         CHECK_OBJECT(var_e);
477         tmp_args_element_name_5 = var_e;
478         CHECK_OBJECT(var_f);
479         tmp_args_element_name_6 = var_f;
480         frame_4310f20717829bd2bbbe58e393dc7abd->m_frame.f_lineno = 41;
481         {
482             PyObject *call_args[] = {tmp_args_element_name_1, tmp_args_element_name_2, tmp_args_element_name_3, tmp_args_element_name_4, tmp_args_element_name_5, tmp_args_element_name_6};
483             tmp_call_result_1 = CALL_FUNCTION_WITH_ARGS6(tmp_called_name_7, call_args);
484         }
485  
486         if (tmp_call_result_1 == NULL) {
487             assert(ERROR_OCCURRED());
488  
489             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
490  
491  
492             exception_lineno = 41;
493             type_description_1 = "ooooooo";
494             goto frame_exception_exit_1;
495         }
496         Py_DECREF(tmp_call_result_1);
497     }
498     {
499         PyObject *tmp_called_name_8;
500         PyObject *tmp_call_result_2;
501         PyObject *tmp_args_element_name_7;
502         PyObject *tmp_args_element_name_8;
503         PyObject *tmp_args_element_name_9;
504         PyObject *tmp_args_element_name_10;
505         PyObject *tmp_args_element_name_11;
506         PyObject *tmp_args_element_name_12;
507         CHECK_OBJECT(var_compiled_f);
508         tmp_called_name_8 = var_compiled_f;
509         CHECK_OBJECT(var_a);
510         tmp_args_element_name_7 = var_a;
511         CHECK_OBJECT(var_c);
512         tmp_args_element_name_8 = var_c;
513         CHECK_OBJECT(var_b);
514         tmp_args_element_name_9 = var_b;
515         CHECK_OBJECT(var_d);
516         tmp_args_element_name_10 = var_d;
517         CHECK_OBJECT(var_e);
518         tmp_args_element_name_11 = var_e;
519         CHECK_OBJECT(var_f);
520         tmp_args_element_name_12 = var_f;
521         frame_4310f20717829bd2bbbe58e393dc7abd->m_frame.f_lineno = 42;
522         {
523             PyObject *call_args[] = {tmp_args_element_name_7, tmp_args_element_name_8, tmp_args_element_name_9, tmp_args_element_name_10, tmp_args_element_name_11, tmp_args_element_name_12};
524             tmp_call_result_2 = CALL_FUNCTION_WITH_ARGS6(tmp_called_name_8, call_args);
525         }
526  
527         if (tmp_call_result_2 == NULL) {
528             assert(ERROR_OCCURRED());
529  
530             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
531  
532  
533             exception_lineno = 42;
534             type_description_1 = "ooooooo";
535             goto frame_exception_exit_1;
536         }
537         Py_DECREF(tmp_call_result_2);
538     }
539     {
540         PyObject *tmp_called_name_9;
541         PyObject *tmp_call_result_3;
542         PyObject *tmp_args_element_name_13;
543         PyObject *tmp_args_element_name_14;
544         PyObject *tmp_args_element_name_15;
545         PyObject *tmp_args_element_name_16;
546         PyObject *tmp_args_element_name_17;
547         PyObject *tmp_args_element_name_18;
548         CHECK_OBJECT(var_compiled_f);
549         tmp_called_name_9 = var_compiled_f;
550         CHECK_OBJECT(var_a);
551         tmp_args_element_name_13 = var_a;
552         CHECK_OBJECT(var_b);
553         tmp_args_element_name_14 = var_b;
554         CHECK_OBJECT(var_c);
555         tmp_args_element_name_15 = var_c;
556         CHECK_OBJECT(var_d);
557         tmp_args_element_name_16 = var_d;
558         CHECK_OBJECT(var_f);
559         tmp_args_element_name_17 = var_f;
560         CHECK_OBJECT(var_e);
561         tmp_args_element_name_18 = var_e;
562         frame_4310f20717829bd2bbbe58e393dc7abd->m_frame.f_lineno = 43;
563         {
564             PyObject *call_args[] = {tmp_args_element_name_13, tmp_args_element_name_14, tmp_args_element_name_15, tmp_args_element_name_16, tmp_args_element_name_17, tmp_args_element_name_18};
565             tmp_call_result_3 = CALL_FUNCTION_WITH_ARGS6(tmp_called_name_9, call_args);
566         }
567  
568         if (tmp_call_result_3 == NULL) {
569             assert(ERROR_OCCURRED());
570  
571             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
572  
573  
574             exception_lineno = 43;
575             type_description_1 = "ooooooo";
576             goto frame_exception_exit_1;
577         }
578         Py_DECREF(tmp_call_result_3);
579     } 455     }
580 456
581 #if 0 457 #if 0
582     RESTORE_FRAME_EXCEPTION(frame_4310f20717829bd2bbbe58e393dc7abd); 458     RESTORE_FRAME_EXCEPTION(frame_4310f20717829bd2bbbe58e393dc7abd);
583 #endif 459 #endif
684     var_d = NULL; 560     var_d = NULL;
685     Py_XDECREF(var_e); 561     Py_XDECREF(var_e);
686     var_e = NULL; 562     var_e = NULL;
687     Py_XDECREF(var_f); 563     Py_XDECREF(var_f);
688     var_f = NULL; 564     var_f = NULL;
t 689     Py_XDECREF(var_compiled_f); t
690     var_compiled_f = NULL;
691     // Re-raise. 565     // Re-raise.
692     exception_type = exception_keeper_type_1; 566     exception_type = exception_keeper_type_1;
693     exception_value = exception_keeper_value_1; 567     exception_value = exception_keeper_value_1;
694     exception_tb = exception_keeper_tb_1; 568     exception_tb = exception_keeper_tb_1;
695     exception_lineno = exception_keeper_lineno_1; 569     exception_lineno = exception_keeper_lineno_1;