Construct RichComparisonStrings

Performance Diagrams

Construct RichComparisonStrings 001000000100000020000002000000300000030000004000000400000050000005000000CPython 2.7Nuitka (master)Nuitka (develop)Nuitka (factory)591316389.78846153846155257.0CPython 2.75150487244.59615384615387288.8727850182589Nuitka (master)5149622399.4038461538462288.90893399769556Nuitka (develop)5150738554.2115384615385288.86229554561316Nuitka (factory)Construct RichComparisonStringsTicks Construct RichComparisonStrings 00100000010000002000000200000030000003000000400000040000005000000500000060000006000000700000070000008000000800000090000009000000CPython 3.5Nuitka (master)Nuitka (develop)Nuitka (factory)909826689.78846153846155257.0CPython 3.58250034244.59615384615387280.03858525603414Nuitka (master)8249964399.4038461538462280.04048650589027Nuitka (develop)8250040554.2115384615385280.03842229176075Nuitka (factory)Construct RichComparisonStringsTicks

Source Code with Construct

module_value1 = "1000"
module_value2 = "2000"

import sys
loop_count = 50000 if len(sys.argv) < 2 else int(sys.argv[1])

import itertools
for x in itertools.repeat(None, loop_count):
# construct_begin
    module_value1 == module_value2
# construct_alternative




print("OK.")

Source Code without Construct

module_value1 = "1000"
module_value2 = "2000"

import sys
loop_count = 50000 if len(sys.argv) < 2 else int(sys.argv[1])

import itertools
for x in itertools.repeat(None, loop_count):
# construct_begin

# construct_alternative
    module_value1
    module_value2
# construct_end

print("OK.")

Context Diff of Source Code


Construct
Baseline
24 loop_count = 50000 if len(sys.argv) < 2 else int(sys.argv[1]) 24 loop_count = 50000 if len(sys.argv) < 2 else int(sys.argv[1])
25 25
26 import itertools 26 import itertools
27 for x in itertools.repeat(None, loop_count): 27 for x in itertools.repeat(None, loop_count):
28 # construct_begin 28 # construct_begin
n 29     module_value1 == module_value2 n 29  
30 # construct_alternative 30 # construct_alternative
t 31   t 31     module_value1
32   32     module_value2
33   33 # construct_end
34 34
35 print("OK.") 35 print("OK.")
36 36

Context Diff of Generated Code


Construct
Baseline
701         CHECK_OBJECT(tmp_for_loop_1__iter_value); 701         CHECK_OBJECT(tmp_for_loop_1__iter_value);
702         tmp_assign_source_11 = tmp_for_loop_1__iter_value; 702         tmp_assign_source_11 = tmp_for_loop_1__iter_value;
703         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11); 703         UPDATE_STRING_DICT0(moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11);
704     } 704     }
705     { 705     {
n 706         PyObject *tmp_compexpr_left_2; n
707         PyObject *tmp_compexpr_right_2;
708         PyObject *tmp_mvar_value_5; 706         PyObject *tmp_mvar_value_5;
n 709         PyObject *tmp_mvar_value_6; n
710         tmp_mvar_value_5 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1); 707         tmp_mvar_value_5 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1);
711 708
712         if (unlikely(tmp_mvar_value_5 == NULL)) { 709         if (unlikely(tmp_mvar_value_5 == NULL)) {
713             tmp_mvar_value_5 = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1); 710             tmp_mvar_value_5 = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1);
714         } 711         }
720             exception_value = UNSTREAM_STRING(&constant_bin[ 57 ], 35, 0); 717             exception_value = UNSTREAM_STRING(&constant_bin[ 57 ], 35, 0);
721             exception_tb = NULL; 718             exception_tb = NULL;
722             NORMALIZE_EXCEPTION(&exception_type, &exception_value, &exception_tb); 719             NORMALIZE_EXCEPTION(&exception_type, &exception_value, &exception_tb);
723             CHAIN_EXCEPTION(exception_value); 720             CHAIN_EXCEPTION(exception_value);
724 721
n 725             exception_lineno = 29; n 722             exception_lineno = 31;
726 723
727             goto try_except_handler_1; 724             goto try_except_handler_1;
728         } 725         }
729 726
n 730         tmp_compexpr_left_2 = tmp_mvar_value_5; n 727     }
728     {
729         PyObject *tmp_mvar_value_6;
731         tmp_mvar_value_6 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2); 730         tmp_mvar_value_6 = GET_STRING_DICT_VALUE(moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2);
732 731
733         if (unlikely(tmp_mvar_value_6 == NULL)) { 732         if (unlikely(tmp_mvar_value_6 == NULL)) {
734             tmp_mvar_value_6 = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2); 733             tmp_mvar_value_6 = GET_STRING_DICT_VALUE(dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2);
735         } 734         }
741             exception_value = UNSTREAM_STRING(&constant_bin[ 92 ], 35, 0); 740             exception_value = UNSTREAM_STRING(&constant_bin[ 92 ], 35, 0);
742             exception_tb = NULL; 741             exception_tb = NULL;
743             NORMALIZE_EXCEPTION(&exception_type, &exception_value, &exception_tb); 742             NORMALIZE_EXCEPTION(&exception_type, &exception_value, &exception_tb);
744             CHAIN_EXCEPTION(exception_value); 743             CHAIN_EXCEPTION(exception_value);
745 744
n 746             exception_lineno = 29; n 745             exception_lineno = 32;
747 746
748             goto try_except_handler_1; 747             goto try_except_handler_1;
749         } 748         }
750 749
t 751         tmp_compexpr_right_2 = tmp_mvar_value_6; t
752         tmp_res = RICH_COMPARE_BOOL_EQ_OBJECT_OBJECT_NORECURSE(tmp_compexpr_left_2, tmp_compexpr_right_2);
753         if (tmp_res == -1) {
754             assert(ERROR_OCCURRED());
755  
756             FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);
757  
758  
759             exception_lineno = 29;
760  
761             goto try_except_handler_1;
762         }
763     } 750     }
764     if (CONSIDER_THREADING() == false) { 751     if (CONSIDER_THREADING() == false) {
765         assert(ERROR_OCCURRED()); 752         assert(ERROR_OCCURRED());
766 753
767         FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb); 754         FETCH_ERROR_OCCURRED(&exception_type, &exception_value, &exception_tb);