Greatly decrease time to write catalog.xml by pulling THEME->GetMetricB out of the inner loop and passing it along to RadarValues. (Also don't copy the vector of Song*.) The time to generate the XNode for Songs was cut down by a fifth (from 2.5 seconds to .5 seconds for me, fully optimized).

This commit is contained in:
Steve Checkoway
2007-02-04 09:35:02 +00:00
parent e17ccc6bdb
commit 169d7c8b44
4 changed files with 33 additions and 26 deletions
+3 -6
View File
@@ -5,9 +5,6 @@
#include "XmlFile.h"
#include "ThemeManager.h"
#define WRITE_COMPLEX_VALUES THEME->GetMetricB("RadarValues","WriteComplexValues")
#define WRITE_SIMPLE_VALUES THEME->GetMetricB("RadarValues","WriteSimpleValues")
RadarValues::RadarValues()
{
MakeUnknown();
@@ -25,7 +22,7 @@ void RadarValues::Zero()
m_Values.f[rc] = 0;
}
XNode* RadarValues::CreateNode() const
XNode* RadarValues::CreateNode( bool bIncludeSimpleValues, bool bIncludeComplexValues ) const
{
XNode* pNode = new XNode( "RadarValues" );
@@ -34,12 +31,12 @@ XNode* RadarValues::CreateNode() const
{
if( rc >= RadarCategory_TapsAndHolds )
{
if( WRITE_SIMPLE_VALUES )
if( bIncludeSimpleValues )
pNode->AppendChild( RadarCategoryToString(rc), (int)m_Values.f[rc] );
}
else
{
if( WRITE_COMPLEX_VALUES )
if( bIncludeComplexValues )
pNode->AppendChild( RadarCategoryToString(rc), m_Values.f[rc] );
}
}