Aggressive performance opts.
This commit is contained in:
@@ -392,7 +392,7 @@ MBTiles.prototype.startWriting = function(callback) {
|
||||
if (!this._isWritable) {
|
||||
this._isWritable = 1;
|
||||
this._clearCaches();
|
||||
this._db.run('PRAGMA synchronous=OFF', callback);
|
||||
this._db.exec('PRAGMA journal_mode = OFF; PRAGMA locking_mode = EXCLUSIVE; PRAGMA synchronous=OFF; PRAGMA cache_size = 400000;', callback);
|
||||
} else {
|
||||
this._isWritable++;
|
||||
return callback(null);
|
||||
@@ -505,7 +505,7 @@ MBTiles.prototype.stopWriting = function(callback) {
|
||||
this._commit(function(err) {
|
||||
if (err) return callback(err);
|
||||
if (!mbtiles._isWritable) {
|
||||
mbtiles._db.run('PRAGMA synchronous=NORMAL', callback);
|
||||
mbtiles._db.exec('PRAGMA journal_mode = DELETE; PRAGMA locking_mode = NORMAL; PRAGMA synchronous=NORMAL; PRAGMA cache_size=2000;', callback);
|
||||
} else {
|
||||
return callback(null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user