Skip to content

Instantly share code, notes, and snippets.

@manu
Last active September 29, 2016 06:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manu/6695546 to your computer and use it in GitHub Desktop.
Save manu/6695546 to your computer and use it in GitHub Desktop.
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