mirror of https://github.com/AxioDL/tinyxml2.git
adjust the size of the memory pools
This commit is contained in:
parent
c97ded4872
commit
ac83b4e278
10
tinyxml2.cpp
10
tinyxml2.cpp
|
@ -1502,11 +1502,11 @@ XMLDocument::~XMLDocument()
|
|||
DeleteChildren();
|
||||
delete [] _charBuffer;
|
||||
|
||||
#if 0
|
||||
textPool.Trace( "text" );
|
||||
elementPool.Trace( "element" );
|
||||
commentPool.Trace( "comment" );
|
||||
attributePool.Trace( "attribute" );
|
||||
#if 1
|
||||
_textPool.Trace( "text" );
|
||||
_elementPool.Trace( "element" );
|
||||
_commentPool.Trace( "comment" );
|
||||
_attributePool.Trace( "attribute" );
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
11
tinyxml2.h
11
tinyxml2.h
|
@ -359,7 +359,16 @@ public:
|
|||
return _nUntracked;
|
||||
}
|
||||
|
||||
enum { COUNT = 1024/SIZE }; // Some compilers do not accept to use COUNT in private part if COUNT is private
|
||||
// This number is perf sensitive. 4k seems like a good tradeoff on my machine.
|
||||
// The test file is large, 170k.
|
||||
// Release: VS2010 gcc(no opt)
|
||||
// 1k: 4000
|
||||
// 2k: 4000
|
||||
// 4k: 3900 21000
|
||||
// 16k: 5200
|
||||
// 32k: 4300
|
||||
// 64k: 4000 21000
|
||||
enum { COUNT = (4*1024)/SIZE }; // Some compilers do not accept to use COUNT in private part if COUNT is private
|
||||
|
||||
private:
|
||||
union Chunk {
|
||||
|
|
|
@ -289,6 +289,7 @@ int main( int argc, const char ** argv )
|
|||
if ( !errorID ) {
|
||||
printf( "Load time=%d\n", loadTime - startTime );
|
||||
printf( "Delete time=%d\n", deleteTime - loadTime );
|
||||
printf( "Total time=%d\n", deleteTime - startTime );
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue