Make LeafNode aligned to memory pages.

Changes:
* LeafNode is aligned to LEAF_PAGE_SIZE.
  Alignment brings 24 bytes memory overhead for 4096, but reduces
  cache misses rate.
* Unused m_element_count from leaf nodes file.
  The size is computed as m_leaves_region.size() / LEAF_PAGE_SIZE.
* Added try/catch for mmap exceptions messages.
This commit is contained in:
Michael Krasnyk
2016-05-01 17:40:58 +02:00
committed by Patrick Niklaus
parent 8849015bbf
commit 2acde49f0f
3 changed files with 35 additions and 50 deletions
+2 -2
View File
@@ -40,7 +40,7 @@ using TestStaticRTree = StaticRTree<TestData,
false,
TEST_BRANCHING_FACTOR,
TEST_LEAF_NODE_SIZE>;
using MiniStaticRTree = StaticRTree<TestData, std::vector<Coordinate>, false, 2, 3>;
using MiniStaticRTree = StaticRTree<TestData, std::vector<Coordinate>, false, 2, 128>;
// Choosen by a fair W20 dice roll (this value is completely arbitrary)
constexpr unsigned RANDOM_SEED = 42;
@@ -266,7 +266,7 @@ void construction_test(const std::string &prefix, FixtureT *fixture)
BOOST_FIXTURE_TEST_CASE(construct_tiny, TestRandomGraphFixture_10_30)
{
using TinyTestTree = StaticRTree<TestData, std::vector<Coordinate>, false, 2, 1>;
using TinyTestTree = StaticRTree<TestData, std::vector<Coordinate>, false, 2, 64>;
construction_test<TinyTestTree>("test_tiny", this);
}