Changeset 409 for trunk/src


Ignore:
Timestamp:
06/21/15 02:44:51 (10 years ago)
Author:
epyon
Message:
  • core/profiler uses new literal_map
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/profiler.cc

    r402 r409  
    2020profiler::profiler()
    2121{
    22         m_root = new node( "root", nullptr );
     22        m_root = new node( "root"_hls64, nullptr );
    2323        m_root->start();
    2424        m_current = m_root;
     
    3030}
    3131
    32 void profiler::start_profile( const string_view& tag )
     32void profiler::start_profile( string_type&& tag )
    3333{
    3434        if ( tag != m_current->m_tag )
    3535        {
    36                 m_current = m_current->request_child( tag );
     36                m_current = m_current->request_child( ::nv::move( tag ) );
    3737        }
    3838        m_current->start();
     
    4747}
    4848
    49 profiler::node::node( const string_view& tag, node* parent )
    50         : m_tag( tag.to_string() )
     49profiler::node::node( string_view tag, node* parent )
     50        : m_tag( ::nv::move( tag ) )
    5151        , m_parent( parent )
    5252        , m_recusion( 0 )
     
    5858}
    5959
    60 profiler::node* profiler::node::request_child( const string_view& tag )
     60profiler::node* profiler::node::request_child( string_type&& tag )
    6161{
    62         std::string stag( tag.to_string() );
    63         auto it = m_children.find( stag );
     62        auto it = m_children.find( tag );
    6463        if ( it != m_children.end() )
    6564                return it->second;
     
    6766        {
    6867                node* result = new node( tag, this );
    69                 m_children[ stag ] = result;
     68                m_children.assign( ::nv::move( tag ), result );
    7069                return result;
    7170        }
     
    131130                        if ( indent > 0 ) nvmemset( buffer, '-', indent );
    132131                        snprintf( buffer + indent, 128 - indent, "%*.*s %6.2f %6d %9.2f %6.2f", indent - 23, 23 - indent,
    133                                 c->m_tag.c_str(), pparent, calls, total_ms, avg_ms );
     132                                c->m_tag.data(), pparent, calls, total_ms, avg_ms );
    134133                        NV_LOG_INFO( string_view( buffer, nvstrlen( buffer ) ) );
    135134                        if ( c->m_children.size() > 0 )
Note: See TracChangeset for help on using the changeset viewer.