Changeset b14dd03


Ignore:
Timestamp:
Apr 12, 2017, 3:57:49 PM (4 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
e869e434
Parents:
eaa5043
Message:

Fix performance bug in C++ virtual benchmark

Location:
doc/generic_types/evaluation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/evaluation/Makefile

    reaa5043 rb14dd03  
    66.PHONY: all clean distclean run-c run-cpp run-cfa run
    77
    8 all: c-bench cpp-bench cfa-bench
     8all: c-bench cpp-bench cfa-bench cpp-vbench
    99
    1010# rewrite object generation to auto-determine deps
  • doc/generic_types/evaluation/cpp-vbench.cpp

    reaa5043 rb14dd03  
    4242        )
    4343
    44         pair max2 = { std::make_unique<boolean>(false), std::make_unique<character>('\0') };
     44        auto max2 = std::make_unique<pair>( std::make_unique<boolean>(false),
     45                std::make_unique<character>('\0') );
    4546        REPEAT_TIMED( "pop_bool_char",
    46                 max2 = std::max( max2, t2.pop()->as<pair>() );
     47                std::unique_ptr<object> x = t2.pop();
     48                if ( x->as<pair>() > *max2 ) { max2.reset( static_cast<pair*>(x.release()) ); }
    4749        )
    4850}
Note: See TracChangeset for help on using the changeset viewer.