Skip to content

Instantly share code, notes, and snippets.

Aaron Heckmann aheckmann

Block or report user

Report or block aheckmann

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/Users/aheckmann/.nvm/versions/node/v4.8.4/bin/node',
1 verbose cli '/Users/aheckmann/.nvm/versions/node/v4.8.4/bin/npm',
1 verbose cli '--registry=https://registry.npmjs.org/',
1 verbose cli '--depth',
1 verbose cli '2',
1 verbose cli 'update' ]
2 info using npm@5.5.1
3 info using node@v4.8.4
4 verbose npm-session 2390aa4c6f224961
View await_thenables.js
'use strict';
// run using this fork of NodeJS
// https://github.com/targos/node/commits/v8-5.4 (https://github.com/nodejs/node/pull/8317)
//
// node --harmony_async_await await_thenables.js
function counter(count) {
return {
then: function(res, rej) {
View lru-cache-perf-issue-node4.js
var LRU = require('lru-cache');
var i = 0;
var sets = 0;
var start = Date.now();
var last = Date.now();
var max = 8193; // 8192 is the magic number upper perf limit of plain objects
var maxAge = 1000 * 60 * 60 * 24;
@aheckmann
aheckmann / parallelism.js
Created Jan 28, 2015
configurable parallelism
View parallelism.js
/**
* example of configurable parallelism
*/
// silly counter
var i = 0;
// configurable amount of work to run in parallel
var max = 1;
@aheckmann
aheckmann / gist:2647d4afe7d0bb760e49
Created Sep 12, 2014
connect to compose.io replset with mongo shell
View gist:2647d4afe7d0bb760e49
mongo -u USERNAME -p PASSWORD --host "REPLICA_SET_NAME/HOST:PORT" --authenticationDatabase DB_NAME
# after connected, you'll need to change the database
// db = db.getSiblingDB(DB_NAME);
@aheckmann
aheckmann / README.md
Last active Dec 30, 2015
bottleneck in amqp.js when publishing large numbers of messages using confirms. see README.md
View README.md

run this with > time DEBUG=amqp:* COUNT=30000 PREFETCH=0 BUCKET_SIZE=20000 node index.js

before applying the fix:

real  1m22.216s
user  1m10.973s
sys 0m16.106s
@aheckmann
aheckmann / generator-fodder
Created Sep 17, 2013
some resources for understanding ES6 generators.
View generator-fodder
http://swannodette.github.io/2013/08/24/es6-generators-and-csp/
https://github.com/visionmedia/co
http://wiki.ecmascript.org/doku.php?id=harmony:generators
http://pag.forbeslindesay.co.uk/
View driver-findAndModifyBug.js
var assert = require('assert')
var uri = 'mongodb://localhost/findAndModifyBug';
var mongo = require('mongodb')
console.log('driver version: %s', mongo.version);
mongo.connect(uri, function (err, db) {
if (err) throw err;
console.log('connected');
@aheckmann
aheckmann / mongoose-cpu-load-test.js
Created Aug 28, 2013
tweak various mongoose settings to observe cpu impact.
View mongoose-cpu-load-test.js
/**
* configuration
*/
// connection pool size
var poolSize = 5;
// number of parallel queries
var n = 60;
View 1652.js
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var assert = require('assert')
console.log('\n===========');
console.log(' mongoose version: %s', mongoose.version);
console.log('========\n\n');
var dbname = 'goosetest-1652';
You can’t perform that action at this time.