Construct RichComparisonConditionStrings

Performance Diagrams

Construct RichComparisonConditionStrings 0010000001000000200000020000003000000300000040000004000000500000050000006000000600000070000007000000800000080000009000000900000010000000100000001100000011000000120000001200000013000000130000001400000014000000CPython 3.10Nuitka (main)Nuitka (develop)Nuitka (factory)1453848788.95192307692307257.0CPython 3.106449765242.31730769230768394.4866344810793Nuitka (main)6449692395.6826923076923394.4878752857846Nuitka (develop)6449590549.0480769230769394.48960901290695Nuitka (factory)Construct RichComparisonConditionStringsTicks Construct RichComparisonConditionStrings 00100000010000002000000200000030000003000000400000040000005000000500000060000006000000700000070000008000000800000090000009000000100000001000000011000000110000001200000012000000130000001300000014000000140000001500000015000000CPython 3.8Nuitka (main)Nuitka (develop)Nuitka (factory)1551205088.95192307692307257.0CPython 3.86524518242.31730769230768400.17626792867975Nuitka (main)6524518395.6826923076923400.17626792867975Nuitka (develop)6524702549.0480769230769400.1733367087076Nuitka (factory)Construct RichComparisonConditionStringsTicks Construct RichComparisonConditionStrings 00100000010000002000000200000030000003000000400000040000005000000500000060000006000000700000070000008000000800000090000009000000100000001000000011000000110000001200000012000000CPython 2.7Nuitka (main)Nuitka (develop)Nuitka (factory)1230915088.95192307692307257.0CPython 2.72724742242.31730769230768449.41415282377494Nuitka (main)2724746395.6826923076923449.4140725207858Nuitka (develop)2724746549.0480769230769449.4140725207858Nuitka (factory)Construct RichComparisonConditionStringsTicks

Source Code with Construct

        y = not y

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

    if y:
# construct_end
        y = not y

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
13 for _x in itertools.repeat(None, loop_count): 13 for _x in itertools.repeat(None, loop_count):
14     x += 1 14     x += 1
15     y = x % 2 == 0 15     y = x % 2 == 0
16 16
17 # construct_begin 17 # construct_begin
n 18     if x % 2 == 0: n 18  
19 # construct_alternative 19 # construct_alternative
t 20   t 20     if y:
21   21 # construct_end
22         y = not y 22         y = not y
23 23
24 print("OK.") 24 print("OK.")
25 25
26 #     Python test originally created or extracted from other peoples work. The 26 #     Python test originally created or extracted from other peoples work. The

Context Diff of Generated Code


Construct
Baseline
814         } 814         }
815         UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[18], tmp_assign_source_13); 815         UPDATE_STRING_DICT1(moduledict___main__, (Nuitka_StringObject *)mod_consts[18], tmp_assign_source_13);
816     } 816     }
817     { 817     {
818         nuitka_bool tmp_condition_result_2; 818         nuitka_bool tmp_condition_result_2;
n 819         PyObject *tmp_cmp_expr_left_3; n 819         PyObject *tmp_mvar_value_1;
820         PyObject *tmp_cmp_expr_right_3; 820         int tmp_truth_name_1;
821         PyObject *tmp_mod_expr_left_2;
822         PyObject *tmp_mod_expr_right_2;
823         tmp_mod_expr_left_2 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[15]); 821         tmp_mvar_value_1 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)mod_consts[18]);
824 822
n 825         if (unlikely(tmp_mod_expr_left_2 == NULL)) { n 823         if (unlikely(tmp_mvar_value_1 == NULL)) {
826             tmp_mod_expr_left_2 = GET_MODULE_VARIABLE_VALUE_FALLBACK(tstate, mod_consts[15]); 824             tmp_mvar_value_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(tstate, mod_consts[18]);
827         } 825         }
828 826
n 829         if (tmp_mod_expr_left_2 == NULL) { n 827         assert(!(tmp_mvar_value_1 == NULL));
828         tmp_truth_name_1 = CHECK_IF_TRUE(tmp_mvar_value_1);
829         if (tmp_truth_name_1 == -1) {
830             assert(HAS_ERROR_OCCURRED(tstate)); 830             assert(HAS_ERROR_OCCURRED(tstate));
831 831
832             FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb); 832             FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb);
833 833
834 834
n 835             exception_lineno = 18; n 835             exception_lineno = 20;
836 836
837             goto try_except_handler_1; 837             goto try_except_handler_1;
838         } 838         }
n 839         tmp_mod_expr_right_2 = mod_consts[10]; n 839         tmp_condition_result_2 = tmp_truth_name_1 == 0 ? NUITKA_BOOL_FALSE : NUITKA_BOOL_TRUE;
840         tmp_cmp_expr_left_3 = BINARY_OPERATION_MOD_OBJECT_OBJECT_INT(tmp_mod_expr_left_2, tmp_mod_expr_right_2);
841         if (tmp_cmp_expr_left_3 == NULL) {
842             assert(HAS_ERROR_OCCURRED(tstate));
843  
844             FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb);
845  
846  
847             exception_lineno = 18;
848  
849             goto try_except_handler_1;
850         }
851         tmp_cmp_expr_right_3 = mod_consts[14];
852         tmp_condition_result_2 = RICH_COMPARE_EQ_NBOOL_OBJECT_INT(tmp_cmp_expr_left_3, tmp_cmp_expr_right_3);
853         Py_DECREF(tmp_cmp_expr_left_3);
854         if (tmp_condition_result_2 == NUITKA_BOOL_EXCEPTION) {
855             assert(HAS_ERROR_OCCURRED(tstate));
856  
857             FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb);
858  
859  
860             exception_lineno = 18;
861  
862             goto try_except_handler_1;
863         }
864         if (tmp_condition_result_2 == NUITKA_BOOL_TRUE) { 840         if (tmp_condition_result_2 == NUITKA_BOOL_TRUE) {
865             goto branch_yes_1; 841             goto branch_yes_1;
866         } else { 842         } else {
867             goto branch_no_1; 843             goto branch_no_1;
868         } 844         }
875 851
876         if (unlikely(tmp_operand_value_1 == NULL)) { 852         if (unlikely(tmp_operand_value_1 == NULL)) {
877             tmp_operand_value_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(tstate, mod_consts[18]); 853             tmp_operand_value_1 = GET_MODULE_VARIABLE_VALUE_FALLBACK(tstate, mod_consts[18]);
878         } 854         }
879 855
t 880         if (tmp_operand_value_1 == NULL) { t 856         assert(!(tmp_operand_value_1 == NULL));
881             assert(HAS_ERROR_OCCURRED(tstate));
882  
883             FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb);
884  
885  
886             exception_lineno = 22;
887  
888             goto try_except_handler_1;
889         }
890         tmp_res = CHECK_IF_TRUE(tmp_operand_value_1); 857         tmp_res = CHECK_IF_TRUE(tmp_operand_value_1);
891         if (tmp_res == -1) { 858         if (tmp_res == -1) {
892             assert(HAS_ERROR_OCCURRED(tstate)); 859             assert(HAS_ERROR_OCCURRED(tstate));
893 860
894             FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb); 861             FETCH_ERROR_OCCURRED(tstate, &exception_type, &exception_value, &exception_tb);