Skip to content

[Enhancement][Build-TimeReduction V1] Remove conversion of KNN Field to string if stored Fields not required #1598

Closed
@navneet1v

Description

@navneet1v

Description

While doing some benchmarks with Opensearch k-NN. I see that there is time going in to convert the kNN field to String even when storedFields is marked as false. On doing deep-dive I found out that, we convert the field to the string and then check if stored field is set as true or false.

Code ref:
https://github.com/opensearch-project/k-NN/blob/main/src/main/java/org/opensearch/knn/index/mapper/KNNVectorFieldMapper.java#L575

Here point.toString will convert the object to string which is expensive operation in high dimensionality use cases.

Refer the Flame graph for the same for Vector dimension: 1536 ingestion

Screenshot 2024-04-08 at 12 58 58 PM

Metadata

Metadata

Assignees

Labels

EnhancementsIncreases software capabilities beyond original client specificationsindexing-improvementsThis label should be attached to all the github issues which will help improving the indexing time.

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions