comment out console-logging of information (useful only for development purpose)

This commit is contained in:
Raymond Hill 2018-10-01 10:14:06 -04:00
parent 23ce7d840e
commit d870ee147d
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 24 additions and 24 deletions

View File

@ -69,12 +69,12 @@ let init = function() {
// time elapse without the instance being used. // time elapse without the instance being used.
let destroy = function() { let destroy = function() {
if ( lz4CodecInstance !== undefined ) { //if ( lz4CodecInstance !== undefined ) {
console.info( // console.info(
'uBO: freeing lz4-block-codec instance (%s KB)', // 'uBO: freeing lz4-block-codec instance (%s KB)',
lz4CodecInstance.bytesInUse() >>> 10 // lz4CodecInstance.bytesInUse() >>> 10
); // );
} //}
lz4CodecInstance = undefined; lz4CodecInstance = undefined;
textEncoder = textDecoder = undefined; textEncoder = textDecoder = undefined;
ttlCount = 0; ttlCount = 0;
@ -107,7 +107,7 @@ let uint8ArrayFromBlob = function(key, data) {
let encodeValue = function(key, value) { let encodeValue = function(key, value) {
if ( !lz4CodecInstance ) { return; } if ( !lz4CodecInstance ) { return; }
let t0 = window.performance.now(); //let t0 = window.performance.now();
if ( textEncoder === undefined ) { if ( textEncoder === undefined ) {
textEncoder = new TextEncoder(); textEncoder = new TextEncoder();
} }
@ -123,20 +123,20 @@ let encodeValue = function(key, value) {
outputArray[5] = (inputSize >>> 8) & 0xFF; outputArray[5] = (inputSize >>> 8) & 0xFF;
outputArray[6] = (inputSize >>> 16) & 0xFF; outputArray[6] = (inputSize >>> 16) & 0xFF;
outputArray[7] = (inputSize >>> 24) & 0xFF; outputArray[7] = (inputSize >>> 24) & 0xFF;
console.info( //console.info(
'uBO: [%s] compressed %d KB => %d KB (%s%%) in %s ms', // 'uBO: [%s] compressed %d KB => %d KB (%s%%) in %s ms',
key, // key,
inputArray.byteLength >> 10, // inputArray.byteLength >> 10,
outputArray.byteLength >> 10, // outputArray.byteLength >> 10,
(outputArray.byteLength / inputArray.byteLength * 100).toFixed(0), // (outputArray.byteLength / inputArray.byteLength * 100).toFixed(0),
(window.performance.now() - t0).toFixed(1) // (window.performance.now() - t0).toFixed(1)
); //);
return outputArray; return outputArray;
}; };
let decodeValue = function(key, inputArray) { let decodeValue = function(key, inputArray) {
if ( !lz4CodecInstance ) { return; } if ( !lz4CodecInstance ) { return; }
let t0 = window.performance.now(); //let t0 = window.performance.now();
if ( if (
inputArray[0] !== 0x18 || inputArray[1] !== 0x4D || inputArray[0] !== 0x18 || inputArray[1] !== 0x4D ||
inputArray[2] !== 0x22 || inputArray[3] !== 0x04 inputArray[2] !== 0x22 || inputArray[3] !== 0x04
@ -152,14 +152,14 @@ let decodeValue = function(key, inputArray) {
textDecoder = new TextDecoder(); textDecoder = new TextDecoder();
} }
let value = textDecoder.decode(outputArray); let value = textDecoder.decode(outputArray);
console.info( //console.info(
'uBO: [%s] decompressed %d KB => %d KB (%s%%) in %s ms', // 'uBO: [%s] decompressed %d KB => %d KB (%s%%) in %s ms',
key, // key,
inputArray.byteLength >>> 10, // inputArray.byteLength >>> 10,
outputSize >>> 10, // outputSize >>> 10,
(inputArray.byteLength / outputSize * 100).toFixed(0), // (inputArray.byteLength / outputSize * 100).toFixed(0),
(window.performance.now() - t0).toFixed(1) // (window.performance.now() - t0).toFixed(1)
); //);
return value; return value;
}; };