Construct RichComparisonStrings

Performance Diagrams

Construct RichComparisonStrings 0010000001000000200000020000003000000300000040000004000000CPython 2.7Nuitka (historic)Nuitka (master)Nuitka (develop)Nuitka (factory)475472274.3076923076923257.0CPython 2.73803690198.15384615384616306.4276297250478Nuitka (historic)4000115322.0296.21890681273516Nuitka (master)3999432445.8461538461538296.2544041157725Nuitka (develop)3999438569.6923076923077296.25409228002104Nuitka (factory)Construct RichComparisonStringsTicks Construct RichComparisonStrings 001000000100000020000002000000300000030000004000000400000050000005000000600000060000007000000700000080000008000000CPython 3.5Nuitka (historic)Nuitka (master)Nuitka (develop)Nuitka (factory)859807474.3076923076923257.0CPython 3.50198.15384615384616504.11538461538464Nuitka (historic)6544896322.0316.0099446868969Nuitka (master)6550080445.8461538461538315.86095246447053Nuitka (develop)6550558569.6923076923077315.8472143698873Nuitka (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])

for x in xrange(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])

for x in xrange(loop_count):
# construct_begin

# construct_alternative
    module_value1
    module_value2
# construct_end

print("OK.")

Context Diff of Source Code


Construct
Baseline
23 import sys 23 import sys
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 for x in xrange(loop_count): 26 for x in xrange(loop_count):
27 # construct_begin 27 # construct_begin
n 28     module_value1 == module_value2 n 28  
29 # construct_alternative 29 # construct_alternative
t 30   t 30     module_value1
31   31     module_value2
32   32 # construct_end
33 33
34 print("OK.") 34 print("OK.")
35 35

Context Diff of Generated Code


Construct
Baseline
302     PyObject *tmp_assign_source_11; 302     PyObject *tmp_assign_source_11;
303     PyObject *tmp_called_name_1; 303     PyObject *tmp_called_name_1;
304     int tmp_cmp_Lt_1; 304     int tmp_cmp_Lt_1;
305     PyObject *tmp_compare_left_1; 305     PyObject *tmp_compare_left_1;
306     PyObject *tmp_compare_right_1; 306     PyObject *tmp_compare_right_1;
n 307     PyObject *tmp_compexpr_left_1; n
308     PyObject *tmp_compexpr_right_1;
309     PyObject *tmp_fromlist_name_1; 307     PyObject *tmp_fromlist_name_1;
310     PyObject *tmp_globals_name_1; 308     PyObject *tmp_globals_name_1;
311     PyObject *tmp_int_arg_1; 309     PyObject *tmp_int_arg_1;
312     PyObject *tmp_iter_arg_1; 310     PyObject *tmp_iter_arg_1;
313     PyObject *tmp_len_arg_1; 311     PyObject *tmp_len_arg_1;
572 570
573     tmp_assign_source_11 = tmp_for_loop_1__iter_value; 571     tmp_assign_source_11 = tmp_for_loop_1__iter_value;
574 572
575     CHECK_OBJECT( tmp_assign_source_11 ); 573     CHECK_OBJECT( tmp_assign_source_11 );
576     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 ); 574     UPDATE_STRING_DICT0( moduledict___main__, (Nuitka_StringObject *)const_str_plain_x, tmp_assign_source_11 );
n 577     tmp_compexpr_left_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 ); n 575     tmp_unused = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value1 );
578 576
n 579     if (unlikely( tmp_compexpr_left_1 == NULL )) n 577     if (unlikely( tmp_unused == NULL ))
580     { 578     {
n 581         tmp_compexpr_left_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 ); n 579         tmp_unused = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value1 );
582     } 580     }
583 581
n 584     if ( tmp_compexpr_left_1 == NULL ) n 582     if ( tmp_unused == NULL )
585     { 583     {
586 584
587         exception_type = PyExc_NameError; 585         exception_type = PyExc_NameError;
588         Py_INCREF( exception_type ); 586         Py_INCREF( exception_type );
589         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" ); 587         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value1" );
590         exception_tb = NULL; 588         exception_tb = NULL;
591         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 589         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
592         CHAIN_EXCEPTION( exception_value ); 590         CHAIN_EXCEPTION( exception_value );
593 591
n 594         exception_lineno = 28; n 592         exception_lineno = 30;
595 593
596         goto try_except_handler_1; 594         goto try_except_handler_1;
597     } 595     }
598 596
n 599     tmp_compexpr_right_1 = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 ); n 597     tmp_unused = GET_STRING_DICT_VALUE( moduledict___main__, (Nuitka_StringObject *)const_str_plain_module_value2 );
600 598
n 601     if (unlikely( tmp_compexpr_right_1 == NULL )) n 599     if (unlikely( tmp_unused == NULL ))
602     { 600     {
n 603         tmp_compexpr_right_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 ); n 601         tmp_unused = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain_module_value2 );
604     } 602     }
605 603
n 606     if ( tmp_compexpr_right_1 == NULL ) n 604     if ( tmp_unused == NULL )
607     { 605     {
608 606
609         exception_type = PyExc_NameError; 607         exception_type = PyExc_NameError;
610         Py_INCREF( exception_type ); 608         Py_INCREF( exception_type );
611         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" ); 609         exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "module_value2" );
612         exception_tb = NULL; 610         exception_tb = NULL;
613         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb ); 611         NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
614         CHAIN_EXCEPTION( exception_value ); 612         CHAIN_EXCEPTION( exception_value );
615 613
n 616         exception_lineno = 28; n 614         exception_lineno = 31;
617 615
618         goto try_except_handler_1; 616         goto try_except_handler_1;
619     } 617     }
620 618
t 621     tmp_unused = RICH_COMPARE_EQ_NORECURSE( tmp_compexpr_left_1, tmp_compexpr_right_1 ); t
622     if ( tmp_unused == NULL )
623     {
624         assert( ERROR_OCCURRED() );
625  
626         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
627  
628  
629         exception_lineno = 28;
630  
631         goto try_except_handler_1;
632     }
633     Py_DECREF( tmp_unused );
634     if ( CONSIDER_THREADING() == false ) 619     if ( CONSIDER_THREADING() == false )
635     { 620     {
636         assert( ERROR_OCCURRED() ); 621         assert( ERROR_OCCURRED() );
637 622
638         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb ); 623         FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );