SamSaffron / flamegraph

Flamegraph profiling support for Ruby 2.0
MIT License
382 stars 36 forks source link

stackprof dependency required for ruby 2.1 #4

Closed chuckbjones closed 9 years ago

chuckbjones commented 9 years ago

I don't know anything about gemspecs, but I assume that since stackprof is only needed for ruby 2.1 that you can't add it as a dependency? If so, this should probably be documented in the README.

For others having this problem: LoadError: cannot load such file -- stackprof, add gem 'stackprof', '~> 0.2.7' to your Gemfile.

jesseiqmi commented 9 years ago

Thanks for the heads up here @chuckbjones

I got distracted with some teammates questions and missed why Unicorn was barfing on me.

Cheers.

SamSaffron commented 9 years ago

sorry, should be fixed now, will push a gem once rubygems is up. stackprof is optional

jesseiqmi commented 9 years ago

Hey @SamSaffron

I know your intentions at the time were to cut a new version of the gem once RG was back up ... still planning on doing so?

The version there is still pegged at 0.0.9.

Thanks! Jess

SamSaffron commented 9 years ago

AHA thanks for the reminder, pushed now.

On Wed, Dec 10, 2014 at 10:13 AM, Jesse Latham notifications@github.com wrote:

Hey @SamSaffron https://github.com/SamSaffron

I know your intentions at the time were to cut a new version of the gem once RG was back up ... still planning on doing so?

The version there is still pegged at 0.0.9.

Thanks! Jess

— Reply to this email directly or view it on GitHub https://github.com/SamSaffron/flamegraph/issues/4#issuecomment-66376698.

jesseiqmi commented 9 years ago

Thanks @SamSaffron!

jesseiqmi commented 9 years ago

@SamSaffron

One more thing Sam.

I just noticed now that when I remove Stackprof from my Gemfile I now get a nag when starting up Unicorn: "Please require the stackprof gem falling back to fast_stack"

Is there any way this can be silenced?

I'm using MiniProfiler (0.9.2) + Flamegraph (0.1.0)

Looks like it's coming from the following (which I'm sure you're intimately familiar with):

if RUBY_VERSION >= "2.1.0".freeze
  begin
    require "stackprof"
  rescue LoadError
    STDERR.puts "Please require the stackprof gem falling back to fast_stack"
    require "fast_stack"
  end
else
  begin
    require "fast_stack"
  rescue LoadError
    STDERR.puts "Please require the fast_stack gem, note flamegraph is only supported on Ruby 2.0 and above"
  end
end
SamSaffron commented 9 years ago

Is there any reason you are do not want to use the stackprof gem? it is faster and more robust than fast_stack (as it used official hooks we built into MRI)

On Wed, Dec 10, 2014 at 2:04 PM, Jesse Latham notifications@github.com wrote:

@SamSaffron https://github.com/SamSaffron

One more thing Sam.

I just noticed now that when I remove Stackprof from my Gemfile I now get a nag when starting up Unicorn: "Please require the stackprof gem falling back to fast_stack"

Is there any way this can be silenced?

I'm using MiniProfiler (0.9.2) + Flamegraph (0.1.0)

Looks like it's coming from the following (which I'm sure you're intimately familiar with):

if RUBY_VERSION >= "2.1.0".freeze begin require "stackprof" rescue LoadError STDERR.puts "Please require the stackprof gem falling back to fast_stack" require "fast_stack" end else begin require "fast_stack" rescue LoadError STDERR.puts "Please require the fast_stack gem, note flamegraph is only supported on Ruby 2.0 and above" end end

— Reply to this email directly or view it on GitHub https://github.com/SamSaffron/flamegraph/issues/4#issuecomment-66397875.

jesseiqmi commented 9 years ago

Well to be honest with you I stumbled across the article from Hacker News last week regarding MiniProfiler and Flamegraph for profiling (so that I could perhaps do away with the overly bloating New Relic for some pieces) and so I haven't done a deep dive into the profiling variants available.

With MiniProfiler and Flamegraph is the preference there to use Stackprof then and not fast_stack which I'm assuming ships with either of those Gems?

I guess I had been looking at it from the point of view to prevent loading too many extra (and possibly unnecessary) dependencies.

Let me know what you think though in terms of performance. I'm running this on my local dev and have it also set up on our staging and demo environments on Heroku. Prod I've left it off of until there's reason to need it.

Thanks.

SamSaffron commented 9 years ago

You would require: false, stackprof so it really adds nothing unless you are profiling, which is not super common in prod. That said the actual impact of stackprof on your process should be very minimal.

On Wed, Dec 10, 2014 at 2:13 PM, Jesse Latham notifications@github.com wrote:

Well to be honest with you I stumbled across the article from Hacker News last week regarding MiniProfiler and Flamegraph for profiling (so that I could perhaps do away with the overly bloating New Relic for some pieces) and so I haven't done a deep dive into the profiling variants available.

With MiniProfiler and Flamegraph is the preference there to use Stackprof then and not fast_stack which I'm assuming ships with either of those Gems?

I guess I had been looking at it from the point of view to prevent loading too many extra (and possibly unnecessary) dependencies.

Let me know what you think though in terms of performance. I'm running this on my local dev and have it also set up on our staging and demo environments on Heroku. Prod I've left it off of until there's reason to need it.

Thanks.

— Reply to this email directly or view it on GitHub https://github.com/SamSaffron/flamegraph/issues/4#issuecomment-66398530.

crivotz commented 9 years ago

Just for info you also receive the message "_Please require the stackprof gem falling back to faststack" if you do rake log:clear or rake tmp:clear

Thanks

marcamillion commented 9 years ago

I am getting that same Please require the stackprof gem falling back to fast_stack error message when I do rake db:migrate.

But the weird thing is it only happens on 1 branch, not both branches.

SamSaffron commented 9 years ago

flamegraph without stackprof on 2.1 is an inferior experience, why are you not including it ?

On Wed, May 20, 2015 at 10:36 AM, Marc Gayle notifications@github.com wrote:

I am getting that same Please require the stackprof gem falling back to fast_stack error message when I do rake db:migrate.

But the weird thing is it only happens on 1 branch, not both branches.

— Reply to this email directly or view it on GitHub https://github.com/SamSaffron/flamegraph/issues/4#issuecomment-103706654 .