Replace PROF_COUNTER with PROF_TIMER in some conditional places.

This commit is contained in:
Alex 2022-09-17 21:43:46 +03:00 committed by Mike Williams
parent 83a7ab2449
commit dc07ab9df1
13 changed files with 17 additions and 17 deletions

View File

@ -309,7 +309,7 @@ void CACHED_CONTAINER::mergeFreeChunks()
return; return;
#ifdef KICAD_GAL_PROFILE #ifdef KICAD_GAL_PROFILE
PROF_COUNTER totalTime; PROF_TIMER totalTime;
#endif /* KICAD_GAL_PROFILE */ #endif /* KICAD_GAL_PROFILE */
// Reversed free chunks map - this one stores chunk size with its offset as the key // Reversed free chunks map - this one stores chunk size with its offset as the key

View File

@ -142,7 +142,7 @@ bool CACHED_CONTAINER_GPU::defragmentResize( unsigned int aNewSize )
return false; return false;
#ifdef KICAD_GAL_PROFILE #ifdef KICAD_GAL_PROFILE
PROF_COUNTER totalTime; PROF_TIMER totalTime;
#endif /* KICAD_GAL_PROFILE */ #endif /* KICAD_GAL_PROFILE */
GLuint newBuffer; GLuint newBuffer;
@ -243,7 +243,7 @@ bool CACHED_CONTAINER_GPU::defragmentResizeMemcpy( unsigned int aNewSize )
return false; return false;
#ifdef KICAD_GAL_PROFILE #ifdef KICAD_GAL_PROFILE
PROF_COUNTER totalTime; PROF_TIMER totalTime;
#endif /* KICAD_GAL_PROFILE */ #endif /* KICAD_GAL_PROFILE */
GLuint newBuffer; GLuint newBuffer;

View File

@ -101,7 +101,7 @@ bool CACHED_CONTAINER_RAM::defragmentResize( unsigned int aNewSize )
return false; return false;
#ifdef KICAD_GAL_PROFILE #ifdef KICAD_GAL_PROFILE
PROF_COUNTER totalTime; PROF_TIMER totalTime;
#endif /* KICAD_GAL_PROFILE */ #endif /* KICAD_GAL_PROFILE */
VERTEX* newBufferMem = static_cast<VERTEX*>( malloc( aNewSize * VERTEX_SIZE ) ); VERTEX* newBufferMem = static_cast<VERTEX*>( malloc( aNewSize * VERTEX_SIZE ) );

View File

@ -272,7 +272,7 @@ void GPU_NONCACHED_MANAGER::DrawIndices( const VERTEX_ITEM* aItem )
void GPU_NONCACHED_MANAGER::EndDrawing() void GPU_NONCACHED_MANAGER::EndDrawing()
{ {
#ifdef KICAD_GAL_PROFILE #ifdef KICAD_GAL_PROFILE
PROF_COUNTER totalRealTime; PROF_TIMER totalRealTime;
#endif /* KICAD_GAL_PROFILE */ #endif /* KICAD_GAL_PROFILE */
if( m_container->GetSize() == 0 ) if( m_container->GetSize() == 0 )

View File

@ -444,7 +444,7 @@ VECTOR2D OPENGL_GAL::getScreenPixelSize() const
void OPENGL_GAL::BeginDrawing() void OPENGL_GAL::BeginDrawing()
{ {
#ifdef KICAD_GAL_PROFILE #ifdef KICAD_GAL_PROFILE
PROF_COUNTER totalRealTime( "OPENGL_GAL::beginDrawing()", true ); PROF_TIMER totalRealTime( "OPENGL_GAL::beginDrawing()", true );
#endif /* KICAD_GAL_PROFILE */ #endif /* KICAD_GAL_PROFILE */
wxASSERT_MSG( m_isContextLocked, "GAL_DRAWING_CONTEXT RAII object should have locked context. " wxASSERT_MSG( m_isContextLocked, "GAL_DRAWING_CONTEXT RAII object should have locked context. "

View File

@ -1130,7 +1130,7 @@ void VIEW::ClearTargets()
void VIEW::Redraw() void VIEW::Redraw()
{ {
#ifdef KICAD_GAL_PROFILE #ifdef KICAD_GAL_PROFILE
PROF_COUNTER totalRealTime; PROF_TIMER totalRealTime;
#endif /* KICAD_GAL_PROFILE */ #endif /* KICAD_GAL_PROFILE */
VECTOR2D screenSize = m_gal->GetScreenPixelSize(); VECTOR2D screenSize = m_gal->GetScreenPixelSize();

View File

@ -108,7 +108,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
return false; return false;
#ifdef PROFILE #ifdef PROFILE
PROF_COUNTER openFiles( "OpenProjectFile" ); PROF_TIMER openFiles( "OpenProjectFile" );
#endif #endif
wxFileName pro = fullFileName; wxFileName pro = fullFileName;

View File

@ -1478,7 +1478,7 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags )
SCHEMATIC_SETTINGS& settings = Schematic().Settings(); SCHEMATIC_SETTINGS& settings = Schematic().Settings();
SCH_SHEET_LIST list = Schematic().GetSheets(); SCH_SHEET_LIST list = Schematic().GetSheets();
#ifdef PROFILE #ifdef PROFILE
PROF_COUNTER timer; PROF_TIMER timer;
#endif #endif
// Ensure schematic graph is accurate // Ensure schematic graph is accurate

View File

@ -187,7 +187,7 @@ void E_SERIE::combine4( uint32_t aSize )
m_results.at( S4R ).e_value = m_results.at( S3R ).e_value; // 4R becomes better than 3R solution m_results.at( S4R ).e_value = m_results.at( S3R ).e_value; // 4R becomes better than 3R solution
#ifdef BENCHMARK #ifdef BENCHMARK
PROF_COUNTER timer; // start timer to count execution time PROF_TIMER timer; // start timer to count execution time
#endif #endif
for( i = 0; i < aSize; i++ ) // 4R search outer loop for( i = 0; i < aSize; i++ ) // 4R search outer loop

View File

@ -207,7 +207,7 @@ bool CN_CONNECTIVITY_ALGO::Add( BOARD_ITEM* aItem )
void CN_CONNECTIVITY_ALGO::searchConnections() void CN_CONNECTIVITY_ALGO::searchConnections()
{ {
#ifdef PROFILE #ifdef PROFILE
PROF_COUNTER garbage_collection( "garbage-collection" ); PROF_TIMER garbage_collection( "garbage-collection" );
#endif #endif
std::vector<CN_ITEM*> garbage; std::vector<CN_ITEM*> garbage;
garbage.reserve( 1024 ); garbage.reserve( 1024 );
@ -219,7 +219,7 @@ void CN_CONNECTIVITY_ALGO::searchConnections()
#ifdef PROFILE #ifdef PROFILE
garbage_collection.Show(); garbage_collection.Show();
PROF_COUNTER search_basic( "search-basic" ); PROF_TIMER search_basic( "search-basic" );
#endif #endif
thread_pool& tp = GetKiCadThreadPool(); thread_pool& tp = GetKiCadThreadPool();

View File

@ -161,7 +161,7 @@ void CONNECTIVITY_DATA::Move( const VECTOR2I& aDelta )
void CONNECTIVITY_DATA::updateRatsnest() void CONNECTIVITY_DATA::updateRatsnest()
{ {
#ifdef PROFILE #ifdef PROFILE
PROF_COUNTER rnUpdate( "update-ratsnest" ); PROF_TIMER rnUpdate( "update-ratsnest" );
#endif #endif
std::vector<RN_NET*> dirty_nets; std::vector<RN_NET*> dirty_nets;

View File

@ -317,7 +317,7 @@ void RN_NET::compute( const std::set< std::pair<KIID, KIID> >& aExclusions )
triangEdges.reserve( m_nodes.size() + m_boardEdges.size() ); triangEdges.reserve( m_nodes.size() + m_boardEdges.size() );
#ifdef PROFILE #ifdef PROFILE
PROF_COUNTER cnt("triangulate"); PROF_TIMER cnt( "triangulate" );
#endif #endif
m_triangulator->Triangulate( triangEdges ); m_triangulator->Triangulate( triangEdges );
#ifdef PROFILE #ifdef PROFILE
@ -331,7 +331,7 @@ void RN_NET::compute( const std::set< std::pair<KIID, KIID> >& aExclusions )
// Get the minimal spanning tree // Get the minimal spanning tree
#ifdef PROFILE #ifdef PROFILE
PROF_COUNTER cnt2("mst"); PROF_TIMER cnt2( "mst" );
#endif #endif
kruskalMST( triangEdges, aExclusions ); kruskalMST( triangEdges, aExclusions );
#ifdef PROFILE #ifdef PROFILE

View File

@ -245,11 +245,11 @@ int polygon_triangulation_main( int argc, char *argv[] )
ignore_unused( poly ); ignore_unused( poly );
#if 0 #if 0
PROF_COUNTER unfrac("unfrac"); PROF_TIMER unfrac("unfrac");
poly.Unfracture( SHAPE_POLY_SET::PM_FAST ); poly.Unfracture( SHAPE_POLY_SET::PM_FAST );
unfrac.Show(); unfrac.Show();
PROF_COUNTER triangulate("triangulate"); PROF_TIMER triangulate("triangulate");
for(int i =0; i< poly.OutlineCount(); i++) for(int i =0; i< poly.OutlineCount(); i++)
{ {