Create a gist now

Instantly share code, notes, and snippets.

@manu /nullconsole.js
Last active Sep 29, 2016

What would you like to do?
In heroku dyno console functions are very costly. Thanks to Michel for helping me to identify this http://micheljansen.org/blog/entry/1698. Prepended the following lines in app.js and it increased the speed of the app very much.
/*
* Add this as first line to app.js speed up Heroku nodejs application
*/
if (process.env.NODE_ENV === 'production') {
var nullfun = function () {};
console.log = nullfun;
console.info = nullfun;
console.error = nullfun;
console.warn = nullfun;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment