mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
make preallocateIfFaster() less noisy. dont want to get unlucky and false indicate it helps especially as it will stay on once it is on.
This commit is contained in:
parent
28c8e6f004
commit
4209f5029f
@ -184,14 +184,14 @@ namespace mongo {
|
||||
}
|
||||
void journalCleanup() { j.cleanup(); }
|
||||
|
||||
bool preallocateIsFaster() {
|
||||
bool _preallocateIsFaster() {
|
||||
bool faster = false;
|
||||
filesystem::path p = getJournalDir() / "tempLatencyTest";
|
||||
try { remove(p); } catch(...) { }
|
||||
try {
|
||||
AlignedBuilder b(8192);
|
||||
int millis[2];
|
||||
const int N = 100;
|
||||
const int N = 50;
|
||||
for( int pass = 0; pass < 2; pass++ ) {
|
||||
LogFile f(p.string());
|
||||
Timer t;
|
||||
@ -214,6 +214,9 @@ namespace mongo {
|
||||
try { remove(p); } catch(...) { }
|
||||
return faster;
|
||||
}
|
||||
bool preallocateIsFaster() {
|
||||
return _preallocateIsFaster() && _preallocateIsFaster() && _preallocateIsFaster();
|
||||
}
|
||||
|
||||
// throws
|
||||
void preallocateFile(filesystem::path p, unsigned long long len) {
|
||||
|
Loading…
Reference in New Issue
Block a user