From 7d039dfa90e99f360c728a7a2ac4924ed442a447 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 24 Apr 2013 14:34:24 +0000 Subject: Added a (commented-out) performance test for biome generator git-svn-id: http://mc-server.googlecode.com/svn/trunk@1409 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Generating/ComposableGenerator.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source') diff --git a/source/Generating/ComposableGenerator.cpp b/source/Generating/ComposableGenerator.cpp index 8219d67c0..71c4005ef 100644 --- a/source/Generating/ComposableGenerator.cpp +++ b/source/Generating/ComposableGenerator.cpp @@ -168,6 +168,19 @@ void cComposableGenerator::InitBiomeGen(cIniFile & a_IniFile) LOGWARNING("Unknown BiomeGen \"%s\", using \"MultiStepMap\" instead.", BiomeGenName.c_str()); } m_BiomeGen = new cBioGenMultiStepMap(Seed); + + /* + // Performance-testing: + LOGINFO("Measuring performance of cBioGenMultiStepMap..."); + clock_t BeginTick = clock(); + for (int x = 0; x < 5000; x++) + { + cChunkDef::BiomeMap Biomes; + m_BiomeGen->GenBiomes(x * 5, x * 5, Biomes); + } + clock_t Duration = clock() - BeginTick; + LOGINFO("cBioGenMultiStepMap for 5000 chunks took %d ticks (%.02f sec)", Duration, (double)Duration / CLOCKS_PER_SEC); + //*/ } // Add a cache, if requested: -- cgit v1.2.3