In Rails projects its common to see shell-enhancement gems only being included in the development / test sections of Gemfiles -- presumably because there is a performance or memory hit if these gems were included into the production Gemfile.

However, because I do quite a lot of work on my Rails production server on Heroku, I would like to pretty my shell up so that it could imitate development more (such as by including back in gems like pry and/or byebug, or awesome_print). However, I can't justify adding them into production if I know it could significantly slow down my app.

So what are the performance implications of including shell-enhancement gems like byebug, pry or awesome_print in Production on Rails? Will they impact the performance of my single dyno production rails server even when I don't have a production server shell open? Is it the memory hit that's a problem, or do these gems also impact the speed of my server even when I don't have a shell open?

1

There are 1 best solutions below

0
On

There isn't really a performance impact. Those gems should not be called during the normal execution of your server. However, I would strongly suggest you set pry and any other such gems as require: false in your Gemfile, to avoid 1) the memory footprint of requiring them, and 2) the possibility that any stray binding.prys left in some obscure code paths in your app will trigger a blocking pry session, pausing the thread and wasting resources on your server.

P.S. A quick Google search turned up a post on the Bugsnag blog detailing how they use pry in production.