Tweaked madvise for index to be faster

This commit is contained in:
vlofgren 2022-05-30 23:19:55 +02:00
parent dc963d3e44
commit 6894121859
2 changed files with 3 additions and 1 deletions

View File

@ -53,8 +53,11 @@ public class SearchIndex implements AutoCloseable {
var h = reader.getHeader(offset);
int length = (int) (h.dataOffsetLongs() - h.indexOffsetLongs());
urls.adviceRange(NativeIO.Advice.Normal, offset, 512);
if (length > 0) {
urls.adviceRange(NativeIO.Advice.WillNeed, h.indexOffsetLongs(), length);
urls.adviceRange(NativeIO.Advice.Normal, h.dataOffsetLongs(), 2048);
urls.pokeRange(h.indexOffsetLongs(), length);
}
});

View File

@ -8,7 +8,6 @@ import com.google.inject.name.Named;
import lombok.SneakyThrows;
import nu.marginalia.wmsa.api.model.ApiSearchResult;
import nu.marginalia.wmsa.api.model.ApiSearchResults;
import nu.marginalia.wmsa.client.exception.TimeoutException;
import nu.marginalia.wmsa.configuration.server.Context;
import nu.marginalia.wmsa.configuration.server.Initialization;
import nu.marginalia.wmsa.configuration.server.MetricsServer;