milvus/internal
Buqian Zheng 1fda4bcae4
enhance: [2.5] add ScalarFieldProto& overload to avoid unnecessary copies (#45744)
1. Array.h: Add output_data(ScalarFieldProto&) overload for both Array
and ArrayView classes
2. Use std::string_view instead of std::string for VARCHAR and GEOMETRY
types to avoid extra string copies
3. Call Reserve(length_) before writing to proto objects to reduce
memory reallocations

a simple test shows those optimizations improve the Array of Varchar
bulk_subscript performance by 20%

issue: https://github.com/milvus-io/milvus/issues/45679
pr: https://github.com/milvus-io/milvus/pull/45743

Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>
2025-11-21 12:39:05 +08:00
..