aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2024-04-16 14:43:23 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2024-04-16 21:19:19 +0000
commit1862d47ff95d80fbd01ad77d3a79e3283f58603f (patch)
tree76034222fcc4da75b924b3ed7703aeeac6b02268 /vespalib
parent302b8f03d28baef770719f8b73315d78fc6da950 (diff)
- Optimize distance calculation for tensors with single dense subspace.
- Let EmptySubspace be invalid. - Add noexcept to get_tensor(s).
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/datastore/array_store.h6
-rw-r--r--vespalib/src/vespa/vespalib/datastore/datastore.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/vespalib/src/vespa/vespalib/datastore/array_store.h b/vespalib/src/vespa/vespalib/datastore/array_store.h
index 4549b81283e..51a1f9fe950 100644
--- a/vespalib/src/vespa/vespalib/datastore/array_store.h
+++ b/vespalib/src/vespa/vespalib/datastore/array_store.h
@@ -94,7 +94,7 @@ private:
EntryRef allocate_dynamic_array(size_t array_size, uint32_t type_id);
EntryRef addLargeArray(ConstArrayRef array);
EntryRef allocate_large_array(size_t array_size);
- ConstArrayRef getSmallArray(RefT ref, size_t arraySize) const {
+ ConstArrayRef getSmallArray(RefT ref, size_t arraySize) const noexcept {
const ElemT *buf = _store.template getEntryArray<ElemT>(ref, arraySize);
return ConstArrayRef(buf, arraySize);
}
@@ -104,7 +104,7 @@ private:
auto size = BufferType::get_dynamic_array_size(entry);
return ConstArrayRef(entry, size);
}
- ConstArrayRef getLargeArray(RefT ref) const {
+ ConstArrayRef getLargeArray(RefT ref) const noexcept {
const LargeArray *buf = _store.template getEntry<LargeArray>(ref);
return ConstArrayRef(&(*buf)[0], buf->size());
}
@@ -114,7 +114,7 @@ public:
ArrayStore(const ArrayStoreConfig &cfg, std::shared_ptr<alloc::MemoryAllocator> memory_allocator, TypeMapper&& mapper);
~ArrayStore() override;
EntryRef add(ConstArrayRef array);
- ConstArrayRef get(EntryRef ref) const {
+ ConstArrayRef get(EntryRef ref) const noexcept {
if (!ref.valid()) [[unlikely]] {
return ConstArrayRef();
}
diff --git a/vespalib/src/vespa/vespalib/datastore/datastore.h b/vespalib/src/vespa/vespalib/datastore/datastore.h
index fa231e9cf94..0226c780cf1 100644
--- a/vespalib/src/vespa/vespalib/datastore/datastore.h
+++ b/vespalib/src/vespa/vespalib/datastore/datastore.h
@@ -96,7 +96,7 @@ public:
EntryRef addEntry(const EntryType &e);
- const EntryType &getEntry(EntryRef ref) const {
+ const EntryType &getEntry(EntryRef ref) const noexcept {
return *this->template getEntry<EntryType>(RefType(ref));
}
};