Skip to content

Instantly share code, notes, and snippets.

View JeanHuguesRobert's full-sized avatar

Jean Hugues Noël Robert JeanHuguesRobert

View GitHub Profile
@bjouhier
bjouhier / benchCallbacks.js
Created April 11, 2012 20:01
streamline vs. callbacks bench
"use strict";
var fs = require('fs');
var cache = {}, hit = 0, missed = 0;
function load(name, cb) {
var res = cache[name];
if (res) {
process.nextTick(function() {
hit++;
cb(null, res);