From 08c45c08d4a127eca7c8f30a6a80b03e3e5b366d Mon Sep 17 00:00:00 2001 From: Mark Nadal Date: Fri, 10 Jan 2020 06:15:05 -0800 Subject: [PATCH] delete logs --- gun.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/gun.js b/gun.js index 1d96356b..c2ddb550 100644 --- a/gun.js +++ b/gun.js @@ -691,7 +691,6 @@ return gun; } function root(msg){ - console.only(4, +new Date - console.S, msg['@']); console.S = +new Date; //add to.next(at); // TODO: MISSING FEATURE!!! var ev = this, as = ev.as, at = as.at || as, gun = at.$, dup, tmp; if(!(tmp = msg['#'])){ tmp = msg['#'] = text_rand(9) } @@ -702,24 +701,19 @@ } return; } - console.only(5, msg['@']); dup.track(tmp); if(!at.ask(msg['@'], msg)){ if(msg.get){ Gun.on.get(msg, gun); //at.on('get', get(msg)); } if(msg.put){ - console.only(6, msg['@']); var S = console.S = +new Date; Gun.on.put(msg, gun); //at.on('put', put(msg)); - console.only(7, msg['@'], '??', +new Date - console.S, 'total', +new Date - S); console.S = +new Date; } } ev.to.next(msg); - console.only(8, msg['@'], +new Date - console.S); console.S = +new Date; if(!as.out){ msg.out = root; at.on('out', msg); - console.only(12, msg['@'], +new Date - console.S); console.S = +new Date; } } }()); @@ -729,12 +723,9 @@ var at = gun._, ctx = {$: gun, graph: at.graph, put: {}, map: {}, souls: {}, machine: Gun.state(), ack: msg['@'], cat: at, stop: {}}; if(!Gun.obj.map(msg.put, perf, ctx)){ return } // HNPERF: performance test, not core code, do not port. if(!Gun.graph.is(msg.put, null, verify, ctx)){ ctx.err = "Error: Invalid graph!" } - console.only(7, ctx.ack, 'after graph check', +new Date - console.S, 'WHAT?', Object.keys(ctx.diff||{}).length, Object.keys(ctx.put||{}).length, Object.keys(ctx.souls||{}).length); console.S = +new Date; if(ctx.err){ return at.on('in', {'@': msg['#'], err: Gun.log(ctx.err) }) } obj_map(ctx.put, merge, ctx); - console.only(8, msg['@'], 'after merge', +new Date - console.S, ctx.async); console.S = +new Date; if(!ctx.async){ obj_map(ctx.map, map, ctx) } - console.only(9, msg['@'], 'after map', +new Date - console.S); console.S = +new Date; if(u !== ctx.defer){ setTimeout(function(){ Gun.on.put(msg, gun); @@ -815,7 +806,6 @@ var next = root.next || (root.next = {}), at = next[soul]; // queue concurrent GETs? if(!node){ return root.on('get', msg) } - console.only(2, 'GET', soul, Object.keys(node||{}).length); console.S = +new Date; if(has){ if('string' != typeof has || !obj_has(node, has)){ return root.on('get', msg) } node = Gun.state.to(node, has); @@ -827,8 +817,6 @@ } node = Gun.graph.node(node); tmp = (at||empty).ack; - console.only(3, 'GET..a', soul, +new Date - console.S); var S = console.S = +new Date; // VVVVVVVVVVVVVVVVVVVVV SLOWEST CODE SO FAR - // SECURITY IS TAKING 0.6 ~ 1sec root.on('in', { '@': msg['#'], how: 'mem', @@ -836,7 +824,6 @@ $: gun, _: faith // HNPERF: see disclaimer below }); - console.only(15, 'GET....b<<', soul, +new Date - S, +new Date - console.S); console.S = +new Date; //if(0 < tmp){ return } root.on('get', msg); } @@ -2022,8 +2009,6 @@ return; } var S; LOG && (S = +new Date); - console.only(); if(msg.get){ console.only.i=1} - console.only(1, msg.get); console.S = +new Date; root.on('in', msg); LOG && !msg.nts && opt.log(S, +new Date - S, 'msg', msg['#']); return; @@ -2043,10 +2028,8 @@ var meta = msg._||(msg._=function(){}); if(!(id = msg['#'])){ id = msg['#'] = Type.text.random(9) } if(!(hash = msg['##']) && u !== msg.put){ hash = msg['##'] = Type.obj.hash(msg.put) } - console.only(9, msg['@'], +new Date - console.S); console.S = +new Date; if(!(raw = meta.raw)){ raw = meta.raw = mesh.raw(msg); - console.only(10, msg['@'], +new Date - console.S); console.S = +new Date; if(hash && (tmp = msg['@'])){ dup.track(tmp+hash).it = msg; if(tmp = (dup.s[tmp]||ok).it){ @@ -2081,7 +2064,6 @@ } peer.batch = []; // peer.batch = '['; // TODO: Prevent double JSON! setTimeout(function(){flush(peer)}, opt.gap); - console.only(11, msg['@'], '>>', +new Date - console.S); console.S = +new Date; send(raw, peer); } function flush(peer){