Performance Profiling a Mongoid Issue Using AppProfiler

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • PopRuby - Clothing and Accessories for Ruby Developers
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • app_profiler

    Collect performance profiles for your Rails application.

    While doing research on Ruby profiling I found Shopify's blog post on "How to Fix Slow Code in Ruby". Though the entire post was extremely insightful, it lead me to Shopify's app_profiler library, which can be used to automatically profile code and redirect the output to a local instance of speedscope. Having worked previously with Flame Graphs of CPU stack traces collected using perf.

  • speedscope

    🔬 A fast, interactive web-based viewer for performance profiles.

    While doing research on Ruby profiling I found Shopify's blog post on "How to Fix Slow Code in Ruby". Though the entire post was extremely insightful, it lead me to Shopify's app_profiler library, which can be used to automatically profile code and redirect the output to a local instance of speedscope. Having worked previously with Flame Graphs of CPU stack traces collected using perf.

  • PopRuby

    PopRuby: Clothing and Accessories for Ruby Developers. Fashion meets Ruby! Shop our fun Ruby-inspired apparel and accessories designed to celebrate the joy and diversity of the Ruby community.

  • FlameGraph

    Stack trace visualizer

    While doing research on Ruby profiling I found Shopify's blog post on "How to Fix Slow Code in Ruby". Though the entire post was extremely insightful, it lead me to Shopify's app_profiler library, which can be used to automatically profile code and redirect the output to a local instance of speedscope. Having worked previously with Flame Graphs of CPU stack traces collected using perf.

  • rubygems

    Library packaging and distribution for Ruby.

    require 'bundler/inline' gemfile do source 'https://rubygems.org' gem 'mongoid' gem 'app_profiler' end class Foo include Mongoid::Document embeds_many :bars end class Bar include Mongoid::Document embedded_in :foo end # AppProfiler forms the output filename using Time.zone.now require 'active_support/core_ext/time/zones' Time.zone = 'Pacific Time (US & Canada)' AppProfiler.root = Pathname.new(__dir__) AppProfiler.profile_root = Pathname.new(__dir__) arr = Array.new(2000) { Bar.new } report = AppProfiler.run(mode: :cpu) do Foo.new.bars = arr end report.view

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts