0
0
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:
Dwight 2011-02-07 12:55:07 -05:00
parent 28c8e6f004
commit 4209f5029f

View File

@ -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) {