View buffer-access-benchmark.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Benchmark = require('benchmark'); | |
var suite = new Benchmark.Suite; | |
global.minOps = 1024; | |
global.undersized = new Buffer(3); | |
global.exactSize = new Buffer(global.minOps); | |
function access(buff, size) { | |
for (var i = 0; i < size; i++) { | |
buff[i]; |
View isEnabledFor_vs_class_benchmark.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
logging.basicConfig(level=logging.INFO) | |
logger = logging.getLogger("log") | |
def simple(): | |
if logger.isEnabledFor(logging.DEBUG): | |
logger.debug( | |
'Stupid log message ' + ' '.join([str(i) for i in range(20)]) | |
) |