Skip to content

Should we separate Panama and Vectorization classes? #15284

@kaivalnp

Description

@kaivalnp

Description

Java's Panama API was finalized in JDK22, which makes it possible to access both on and off-heap memory without special MR-JAR requirements in Lucene

However for vector search, our code for Panama + Vector API is tightly coupled (see PanamaVectorUtilSupport) -- so a user can only benefit from off-heap improvements when they have vectorization enabled (--add-modules jdk.incubator.vector)

Should we separate classes for the two? This would mean having all vector comparisons support on and off-heap versions, and only keeping functions related to vectorization in java25/ (i.e. in an MR-JAR)

IMO it would provide a cleaner separation of functionality and simplify code a bit too (for e.g. we can move classes like Lucene99MemorySegmentByteVectorScorer out of java25/) + users that do not enable vectorization can score vectors off-heap

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions