generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 169
Open
Labels
EnhancementsIncreases software capabilities beyond original client specificationsIncreases software capabilities beyond original client specifications
Description
Description
When memory-optimized search is enabled, the warm-up operation performs a partial index load and determines the starting offset of each logical section within the index. This does not load anything from an underlying file or stream.
Because of this, users still incur the startup cost regardless of using the warm-up API.
Code reference: KNNIndexShard.java#L114-L118
In this proposal, we start with a simple approach that touches the entire file, indirectly delegating page loading to the kernel. With this mechanism, once an index has been warmed up, the cold start overhead will be reduced compared to when this optimization is absent.
Pseudocode:
if (directory is not FSDirectory) {
// Do partial loading
...
return
}
IndexInput input = ...; // Get random accessor from FSDirectory
long fileSize = input.length();
for (long i = 0 ; i < fileSize ; i += 4096) {
// Touch 1 byte from each page to trigger page fault, then kernel will load 4KB page from the file.
input.readByte();
}
Metadata
Metadata
Assignees
Labels
EnhancementsIncreases software capabilities beyond original client specificationsIncreases software capabilities beyond original client specifications
Type
Projects
Status
3.x