Madvise tweaks (#21)
Co-authored-by: vlofgren <vlofgren@gmail.com> Reviewed-on: https://git.marginalia.nu/marginalia/marginalia.nu/pulls/21
This commit is contained in:
parent
44bee371e6
commit
c7a095e497
@ -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);
|
||||
}
|
||||
});
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user