Hired Engineering
Published in

Hired Engineering

Why are those specs SO slow?

Introduction

Instrumentation

Most common bottlenecks

Generate the report

TAG_PROF=type \
TAG_PROF_EVENT='sql.active_record,factory_bot.run_factory,render_template.action_view,rspec.before_each' \
bundle exec rspec --exclude-pattern "spec/features/**/*_spec.rb"

How To Read The Report

time                           47:36.967
sql.active_record 02:20.415
factory_bot.run_factory 06:11.566
render_template.action_view 03:22.463
rspec.before_each 05:32.551
total 4015
%total 16.01
%time 35.08
avg 00:00.711
time                           27:59.610
sql.active_record 03:31.499
factory_bot.run_factory 22:45.682
render_template.active_view 00:00.064
rspec.before_each 11:21.385
total 8291
%total 33.07
%time 20.62
%avg 00:00.202

Epilogue

--

--

A place for our engineers to talk about what we’ve learned while building Hired

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store