Construct CallCompiledFunctionPosArgsVariable

Performance Diagrams

Construct CallCompiledFunctionPosArgsVariable 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000CPython 3.10Nuitka (main)Nuitka (develop)Nuitka (factory)18268884188.11538461538461257.0CPython 3.1046050061240.03846153846155441.82543590649266Nuitka (main)46049757391.96153846153845441.8258471142955Nuitka (develop)46050162543.8846153846154441.8252992881107Nuitka (factory)Construct CallCompiledFunctionPosArgsVariableTicks Construct CallCompiledFunctionPosArgsVariable 00100000001000000020000000200000003000000030000000400000004000000050000000500000006000000060000000700000007000000080000000800000009000000090000000100000000100000000110000000110000000120000000120000000130000000130000000140000000140000000150000000150000000CPython 3.8Nuitka (main)Nuitka (develop)Nuitka (factory)15981469488.11538461538461257.0CPython 3.842600384240.03846153846155438.2440306526315Nuitka (main)42600137391.96153846153845438.2444125793397Nuitka (develop)42599673543.8846153846154438.24513004489677Nuitka (factory)Construct CallCompiledFunctionPosArgsVariableTicks Construct CallCompiledFunctionPosArgsVariable 002000000020000000400000004000000060000000600000008000000080000000100000000100000000120000000120000000140000000140000000160000000160000000180000000180000000CPython 2.7Nuitka (main)Nuitka (develop)Nuitka (factory)18265689888.11538461538461257.0CPython 2.745148540240.03846153846155443.0342048237346Nuitka (main)45148618391.96153846153845443.0340992980183Nuitka (develop)45148548543.8846153846154443.03419400058425Nuitka (factory)Construct CallCompiledFunctionPosArgsVariableTicks

Source Code with Construct

    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


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

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

    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


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

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
25     compiled_f = compiled_func 25     compiled_f = compiled_func
26 26
27     # This is supposed to make a call to a compiled function, which is 27     # This is supposed to make a call to a compiled function, which is
28     # being optimized separately. 28     # being optimized separately.
29     # construct_begin 29     # construct_begin
n 30     compiled_f(a, b, c, d, e, f) n
31     compiled_f(a, c, b, d, e, f)
32     compiled_f(a, b, c, d, f, e)
33     # construct_alternative
34 30
35 31
t t 32  
33     # construct_alternative
34     pass
35     # construct_end
36 36
37     return compiled_f 37     return compiled_f
38 38
39 39
40 for x in itertools.repeat(None, 50000): 40 for x in itertools.repeat(None, 50000):

Context Diff of Generated Code


Construct
Baseline
190     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL; 190     NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL;
191     PyObject *exception_type = NULL; 191     PyObject *exception_type = NULL;
192     PyObject *exception_value = NULL; 192     PyObject *exception_value = NULL;
193     PyTracebackObject *exception_tb = NULL; 193     PyTracebackObject *exception_tb = NULL;
194     NUITKA_MAY_BE_UNUSED int exception_lineno = 0; 194     NUITKA_MAY_BE_UNUSED int exception_lineno = 0;
n 195     NUITKA_MAY_BE_UNUSED nuitka_void tmp_unused; n
196     static struct Nuitka_FrameObject *cache_frame_f5a6d2256073892ed6760351e1260e2d = NULL; 195     static struct Nuitka_FrameObject *cache_frame_f5a6d2256073892ed6760351e1260e2d = NULL;
197     PyObject *tmp_return_value = NULL; 196     PyObject *tmp_return_value = NULL;
198     PyObject *exception_keeper_type_1; 197     PyObject *exception_keeper_type_1;
199     PyObject *exception_keeper_value_1; 198     PyObject *exception_keeper_value_1;
200     PyTracebackObject *exception_keeper_tb_1; 199     PyTracebackObject *exception_keeper_tb_1;
452             goto frame_exception_exit_1; 451             goto frame_exception_exit_1;
453         } 452         }
454         assert(var_compiled_f == NULL); 453         assert(var_compiled_f == NULL);
455         Py_INCREF(tmp_assign_source_7); 454         Py_INCREF(tmp_assign_source_7);
456         var_compiled_f = tmp_assign_source_7; 455         var_compiled_f = tmp_assign_source_7;
n 457     } n
458     {
459         PyObject *tmp_called_value_7;
460         PyObject *tmp_call_result_1;
461         PyObject *tmp_args_element_value_1;
462         PyObject *tmp_args_element_value_2;
463         PyObject *tmp_args_element_value_3;
464         PyObject *tmp_args_element_value_4;
465         PyObject *tmp_args_element_value_5;
466         PyObject *tmp_args_element_value_6;
467         CHECK_OBJECT(var_compiled_f);
468         tmp_called_value_7 = var_compiled_f;
469         CHECK_OBJECT(var_a);
470         tmp_args_element_value_1 = var_a;
471         CHECK_OBJECT(var_b);
472         tmp_args_element_value_2 = var_b;
473         CHECK_OBJECT(var_c);
474         tmp_args_element_value_3 = var_c;
475         CHECK_OBJECT(var_d);
476         tmp_args_element_value_4 = var_d;
477         CHECK_OBJECT(var_e);
478         tmp_args_element_value_5 = var_e;
479         CHECK_OBJECT(var_f);
480         tmp_args_element_value_6 = var_f;
481         frame_f5a6d2256073892ed6760351e1260e2d->m_frame.f_lineno = 30;
482         {
483             PyObject *call_args[] = {tmp_args_element_value_1, tmp_args_element_value_2, tmp_args_element_value_3, tmp_args_element_value_4, tmp_args_element_value_5, tmp_args_element_value_6};
484             tmp_call_result_1 = CALL_FUNCTION_WITH_ARGS6(tstate, tmp_called_value_7, call_args);
485         }
486  
487         if (tmp_call_result_1 == NULL) {
488             assert(HAS_ERROR_OCCURRED(tstate));
489  
490             FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb);
491  
492  
493             exception_lineno = 30;
494             type_description_1 = "ooooooo";
495             goto frame_exception_exit_1;
496         }
497         Py_DECREF(tmp_call_result_1);
498     }
499     {
500         PyObject *tmp_called_value_8;
501         PyObject *tmp_call_result_2;
502         PyObject *tmp_args_element_value_7;
503         PyObject *tmp_args_element_value_8;
504         PyObject *tmp_args_element_value_9;
505         PyObject *tmp_args_element_value_10;
506         PyObject *tmp_args_element_value_11;
507         PyObject *tmp_args_element_value_12;
508         CHECK_OBJECT(var_compiled_f);
509         tmp_called_value_8 = var_compiled_f;
510         CHECK_OBJECT(var_a);
511         tmp_args_element_value_7 = var_a;
512         CHECK_OBJECT(var_c);
513         tmp_args_element_value_8 = var_c;
514         CHECK_OBJECT(var_b);
515         tmp_args_element_value_9 = var_b;
516         CHECK_OBJECT(var_d);
517         tmp_args_element_value_10 = var_d;
518         CHECK_OBJECT(var_e);
519         tmp_args_element_value_11 = var_e;
520         CHECK_OBJECT(var_f);
521         tmp_args_element_value_12 = var_f;
522         frame_f5a6d2256073892ed6760351e1260e2d->m_frame.f_lineno = 31;
523         {
524             PyObject *call_args[] = {tmp_args_element_value_7, tmp_args_element_value_8, tmp_args_element_value_9, tmp_args_element_value_10, tmp_args_element_value_11, tmp_args_element_value_12};
525             tmp_call_result_2 = CALL_FUNCTION_WITH_ARGS6(tstate, tmp_called_value_8, call_args);
526         }
527  
528         if (tmp_call_result_2 == NULL) {
529             assert(HAS_ERROR_OCCURRED(tstate));
530  
531             FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb);
532  
533  
534             exception_lineno = 31;
535             type_description_1 = "ooooooo";
536             goto frame_exception_exit_1;
537         }
538         Py_DECREF(tmp_call_result_2);
539     }
540     {
541         PyObject *tmp_called_value_9;
542         PyObject *tmp_call_result_3;
543         PyObject *tmp_args_element_value_13;
544         PyObject *tmp_args_element_value_14;
545         PyObject *tmp_args_element_value_15;
546         PyObject *tmp_args_element_value_16;
547         PyObject *tmp_args_element_value_17;
548         PyObject *tmp_args_element_value_18;
549         CHECK_OBJECT(var_compiled_f);
550         tmp_called_value_9 = var_compiled_f;
551         CHECK_OBJECT(var_a);
552         tmp_args_element_value_13 = var_a;
553         CHECK_OBJECT(var_b);
554         tmp_args_element_value_14 = var_b;
555         CHECK_OBJECT(var_c);
556         tmp_args_element_value_15 = var_c;
557         CHECK_OBJECT(var_d);
558         tmp_args_element_value_16 = var_d;
559         CHECK_OBJECT(var_f);
560         tmp_args_element_value_17 = var_f;
561         CHECK_OBJECT(var_e);
562         tmp_args_element_value_18 = var_e;
563         frame_f5a6d2256073892ed6760351e1260e2d->m_frame.f_lineno = 32;
564         {
565             PyObject *call_args[] = {tmp_args_element_value_13, tmp_args_element_value_14, tmp_args_element_value_15, tmp_args_element_value_16, tmp_args_element_value_17, tmp_args_element_value_18};
566             tmp_call_result_3 = CALL_FUNCTION_WITH_ARGS6(tstate, tmp_called_value_9, call_args);
567         }
568  
569         if (tmp_call_result_3 == NULL) {
570             assert(HAS_ERROR_OCCURRED(tstate));
571  
572             FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb);
573  
574  
575             exception_lineno = 32;
576             type_description_1 = "ooooooo";
577             goto frame_exception_exit_1;
578         }
579         Py_DECREF(tmp_call_result_3);
580     } 456     }
581 457
582 458
583     // Put the previous frame back on top. 459     // Put the previous frame back on top.
584     popFrameStack(tstate); 460     popFrameStack(tstate);
676     var_d = NULL; 552     var_d = NULL;
677     Py_XDECREF(var_e); 553     Py_XDECREF(var_e);
678     var_e = NULL; 554     var_e = NULL;
679     Py_XDECREF(var_f); 555     Py_XDECREF(var_f);
680     var_f = NULL; 556     var_f = NULL;
t 681     Py_XDECREF(var_compiled_f); t
682     var_compiled_f = NULL;
683     // Re-raise. 557     // Re-raise.
684     exception_type = exception_keeper_type_1; 558     exception_type = exception_keeper_type_1;
685     exception_value = exception_keeper_value_1; 559     exception_value = exception_keeper_value_1;
686     exception_tb = exception_keeper_tb_1; 560     exception_tb = exception_keeper_tb_1;
687     exception_lineno = exception_keeper_lineno_1; 561     exception_lineno = exception_keeper_lineno_1;