diff --git a/Gemfile b/Gemfile
index 97d10ce54..7e71e2b23 100644
--- a/Gemfile
+++ b/Gemfile
@@ -168,6 +168,7 @@ gem 'htmlentities', require: false
 #  If you want to amend mini profiler to do the monkey patches in the railties
 #  we are open to it. by deferring require to the initializer we can configure discourse installs without it
 
+gem 'fast_stack', require: false, platform: [:mri_20]
 gem 'flamegraph', require: false
 gem 'rack-mini-profiler', require: false
 
diff --git a/Gemfile.lock b/Gemfile.lock
index 8c8a55b3c..e059b7d35 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -101,16 +101,12 @@ GEM
     faraday (0.9.2)
       multipart-post (>= 1.2, < 3)
     fast_blank (1.0.0)
-    fast_stack (0.1.0)
-      rake
-      rake-compiler
     fast_xor (1.1.3)
       rake
       rake-compiler
     fast_xs (0.8.0)
     ffi (1.9.10)
-    flamegraph (0.1.0)
-      fast_stack
+    flamegraph (0.9.5)
     foreman (0.78.0)
       thor (~> 0.19.1)
     fspath (2.1.1)
@@ -273,7 +269,7 @@ GEM
       thor (>= 0.18.1, < 2.0)
     raindrops (0.15.0)
     rake (10.5.0)
-    rake-compiler (0.9.5)
+    rake-compiler (0.9.9)
       rake
     rb-fsevent (0.9.7)
     rb-inotify (0.9.5)
@@ -373,7 +369,7 @@ GEM
       actionpack (>= 4.0)
       activesupport (>= 4.0)
       sprockets (>= 3.0.0)
-    stackprof (0.2.7)
+    stackprof (0.2.9)
     therubyracer (0.12.2)
       libv8 (~> 3.16.14.0)
       ref
@@ -421,6 +417,7 @@ DEPENDENCIES
   fabrication (= 2.9.8)
   fakeweb (~> 1.3.0)
   fast_blank
+  fast_stack
   fast_xor
   fast_xs
   flamegraph