profiler.
This commit is contained in:
parent
cb6b43f0b6
commit
24ff3fe6d4
@ -215,6 +215,8 @@ Chain.prototype._init = function _init() {
|
|||||||
network.height = tip.height;
|
network.height = tip.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bcoin.profiler.snapshot();
|
||||||
|
|
||||||
self._getInitialState(function(err) {
|
self._getInitialState(function(err) {
|
||||||
if (err)
|
if (err)
|
||||||
return self.emit('error', err);
|
return self.emit('error', err);
|
||||||
@ -225,6 +227,8 @@ Chain.prototype._init = function _init() {
|
|||||||
if (self.segwitActive)
|
if (self.segwitActive)
|
||||||
bcoin.debug('Segwit is active.');
|
bcoin.debug('Segwit is active.');
|
||||||
|
|
||||||
|
bcoin.profiler.snapshot();
|
||||||
|
|
||||||
self.loaded = true;
|
self.loaded = true;
|
||||||
self.emit('open');
|
self.emit('open');
|
||||||
self.emit('tip', tip);
|
self.emit('tip', tip);
|
||||||
@ -1596,7 +1600,7 @@ Chain.prototype.add = function add(block, callback, force) {
|
|||||||
self.total += total;
|
self.total += total;
|
||||||
|
|
||||||
// Take heap snapshot for debugging.
|
// Take heap snapshot for debugging.
|
||||||
if (self.total % 20 === 0) {
|
if (self.total === 1 || self.total % 20 === 0) {
|
||||||
utils.gc();
|
utils.gc();
|
||||||
bcoin.profiler.snapshot();
|
bcoin.profiler.snapshot();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user