Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYury Melnichek <melnichek@gmail.com>2011-04-29 11:49:14 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:17:29 +0300
commit0adf1ae55b4f9cbabef1e3ea191f084b45214d90 (patch)
tree49a1e3ba8a42647fc57751d1f8d5b9f93c4391ce /indexer/interval_index_builder.hpp
parentb9d98b82f00bc677726a18abda5b6cc520e7394a (diff)
Log node density in the indexer.
Diffstat (limited to 'indexer/interval_index_builder.hpp')
-rw-r--r--indexer/interval_index_builder.hpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/indexer/interval_index_builder.hpp b/indexer/interval_index_builder.hpp
index 4888e1251b..cbbeb0857b 100644
--- a/indexer/interval_index_builder.hpp
+++ b/indexer/interval_index_builder.hpp
@@ -124,6 +124,9 @@ void BuildIntervalIndex(CellIdValueIterT const & beg, CellIdValueIterT const & e
{
// LOG(LINFO, ("Building interval index, level", level));
uint64_t const initialLevelWriterPos = writer.Pos();
+ uint64_t totalPopcount = 0;
+ uint32_t maxPopCount = 0;
+ uint64_t nodesWritten = 0;
BitsetType bitMask = BitsetType();
uint64_t prevKey = 0;
@@ -137,6 +140,10 @@ void BuildIntervalIndex(CellIdValueIterT const & beg, CellIdValueIterT const & e
{
// Write node for the previous parent.
impl::WriteIntervalIndexNode(writer, childOffset, bitsPerLevel, bitMask);
+ uint32_t const popCount = bitMask.PopCount();
+ totalPopcount += popCount;
+ maxPopCount = max(maxPopCount, popCount);
+ ++nodesWritten;
childOffset = nextChildOffset;
bitMask = BitsetType();
}
@@ -155,13 +162,18 @@ void BuildIntervalIndex(CellIdValueIterT const & beg, CellIdValueIterT const & e
// Write the last node.
impl::WriteIntervalIndexNode(writer, childOffset, bitsPerLevel, bitMask);
+ uint32_t const popCount = bitMask.PopCount();
+ totalPopcount += popCount;
+ maxPopCount = max(maxPopCount, popCount);
+ ++nodesWritten;
if (level == 1)
nextChildOffset += nodeSize;
childOffset = nextChildOffset;
- LOG(LINFO, ("Level:", level, "size:", writer.Pos() - initialLevelWriterPos));
+ LOG(LINFO, ("Level:", level, "size:", writer.Pos() - initialLevelWriterPos, \
+ "density:", double(totalPopcount) / nodesWritten, "max density:", maxPopCount));
}
// Write the dummy one-after-last node.