aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahooinc.com>2023-02-15 17:15:17 +0100
committerGitHub <noreply@github.com>2023-02-15 17:15:17 +0100
commit6311d48315bf6baced43d8d1a5c2b9308bf543e4 (patch)
treefd06625e60a4b5f530facf6453d548e6d8f2c82a /vespalib
parent994c07cb9470017c4855a0d7523a09a5bdca1d88 (diff)
parent5a66f8e7375bafccf365a1448bd2709fea623335 (diff)
Merge pull request #26054 from vespa-engine/toregge/add-exponential-array-size-growth-to-tensor-buffer-type-mapperv8.127.1v8.126.20
Add exponential array size growth to tensor buffer type mapper.
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/datastore/array_store.h2
-rw-r--r--vespalib/src/vespa/vespalib/datastore/array_store.hpp2
-rw-r--r--vespalib/src/vespa/vespalib/datastore/array_store_type_mapper.h1
3 files changed, 4 insertions, 1 deletions
diff --git a/vespalib/src/vespa/vespalib/datastore/array_store.h b/vespalib/src/vespa/vespalib/datastore/array_store.h
index c76b71ae34e..9e403a52b44 100644
--- a/vespalib/src/vespa/vespalib/datastore/array_store.h
+++ b/vespalib/src/vespa/vespalib/datastore/array_store.h
@@ -144,6 +144,8 @@ public:
bool has_free_lists_enabled() const { return _store.has_free_lists_enabled(); }
bool has_held_buffers() const noexcept { return _store.has_held_buffers(); }
+ const TypeMapper& get_mapper() const noexcept { return _mapper; }
+
static ArrayStoreConfig optimizedConfigForHugePage(uint32_t maxSmallArrayTypeId,
size_t hugePageSize,
size_t smallPageSize,
diff --git a/vespalib/src/vespa/vespalib/datastore/array_store.hpp b/vespalib/src/vespa/vespalib/datastore/array_store.hpp
index 4276318f993..53b149fda80 100644
--- a/vespalib/src/vespa/vespalib/datastore/array_store.hpp
+++ b/vespalib/src/vespa/vespalib/datastore/array_store.hpp
@@ -220,7 +220,7 @@ ArrayStore<EntryT, RefT, TypeMapperT>::optimizedConfigForHugePage(uint32_t maxSm
size_t minNumArraysForNewBuffer,
float allocGrowFactor)
{
- return ArrayStoreConfig::optimizeForHugePage(maxSmallArrayTypeId,
+ return ArrayStoreConfig::optimizeForHugePage(mapper.get_max_small_array_type_id(maxSmallArrayTypeId),
[&](uint32_t type_id) noexcept { return mapper.get_array_size(type_id); },
hugePageSize,
smallPageSize,
diff --git a/vespalib/src/vespa/vespalib/datastore/array_store_type_mapper.h b/vespalib/src/vespa/vespalib/datastore/array_store_type_mapper.h
index 0fc1073d577..1b1e085ed16 100644
--- a/vespalib/src/vespa/vespalib/datastore/array_store_type_mapper.h
+++ b/vespalib/src/vespa/vespalib/datastore/array_store_type_mapper.h
@@ -23,6 +23,7 @@ public:
uint32_t get_type_id(size_t array_size) const { return array_size; }
size_t get_array_size(uint32_t type_id) const { return type_id; }
+ static uint32_t get_max_small_array_type_id(uint32_t max_small_array_type_id) noexcept { return max_small_array_type_id; }
};
}