ple: the slow-direct probe only warns on every platform (#2040: a SATA SSD tops out under the NVMe-calibrated 15K rows/s bar and mmap was 7x slower there); STRATA_PLE_AUTO_MMAP=1 keeps the 0.1.42 switch

This commit is contained in:
Niko1221 committed 2026-10-12 09:44:07 +02:00
1 parent 661ff29339
commit 0cf3d51030
3 files changed
+9 -11

No files matched your search

+4 -5
View File
@@ -3186,13 +3186,12 @@ int main(int argc, char** argv) {
if (rps >= kSlowRowsPerS)
std::fprintf(stderr, "strata generate: PLE direct read probe: %.0f rows/s (fine)\n", rps);
if (rps > 0 && rps < kSlowRowsPerS) {
// #1984 #1971: on Windows the mapped reads stalled prompts (the first chunk waits for 16 serial page faults
// a token from a cold table with no progress mark), so there the switch is only made when asked for
// #1984 #1971 #2040: on no platform is the switch made on its own. Windows: the mapped reads stalled prompts (the first chunk waits for 16 serial page faults
// a token from a cold table with no progress mark). Linux SATA SSD: the 15K rows/s bar is NVMe-calibrated, a SATA SSD
// tops out at 10-14K with direct's 16 reads in flight and mapped reads were 7x slower. The switch is only made when asked for
// (STRATA_PLE_AUTO_MMAP=1, the 0.1.42 behaviour); otherwise the slow probe warns and direct is kept.
bool auto_mmap = !o.ple_io_explicit;
#if defined(_WIN32)
if (const char* am = std::getenv("STRATA_PLE_AUTO_MMAP"); am == nullptr || std::atoi(am) == 0) auto_mmap = false;
#endif
if (auto_mmap) {
std::fprintf(stderr, "strata generate: --ple-io direct measures slow here (%.0f rows/s, about %.0f MB/s of "
"random 4 KiB reads): using --ple-io mmap instead (the OS file cache holds the pages; "
@@ -3208,7 +3207,7 @@ int main(int argc, char** argv) {
} else {
std::fprintf(stderr, "strata generate: WARNING: --ple-io direct measures slow here (%.0f rows/s, about %.0f "
"MB/s of random 4 KiB reads): a prompt can spend minutes reading layer 1 and trip the "
"stall watchdog (#1425, #1629). --ple-io mmap was 40-100x faster on such drives; "
"stall watchdog (#1425, #1629). --ple-io mmap was 40-100x faster on some DRAM-less NVMe drives but 7x slower on a SATA SSD (#2040), so it is not chosen for you; "
"--ple-io ram needs the RAM for the table%s\n", rps, rps * 4096.0 / 1e6,
o.ple_io_explicit ? "" : " (kept direct: pass --ple-io mmap or --ple-io ram to change it)");
}