From 1bec028a0925804cf4b1fec30849abca9c2d0646 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 4 Mar 2026 11:45:16 +1100 Subject: [PATCH] Add gem for spring to listen to filesystem changes efficiently I found that each spring process was using around 3% CPU in the background just scanning for file changes. By default, spring polls the file system every 0.2 seconds. With the added gem, I can't see any CPU use of spring in the background. --- Gemfile | 1 + Gemfile.lock | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Gemfile b/Gemfile index 9f712c07b6..5aaca09582 100644 --- a/Gemfile +++ b/Gemfile @@ -203,6 +203,7 @@ group :development do gem 'spring' gem 'spring-commands-rspec' gem 'spring-commands-rubocop' + gem 'spring-watcher-listen' gem 'web-console' gem 'rack-mini-profiler', '< 3.0.0' diff --git a/Gemfile.lock b/Gemfile.lock index d3ce3cd3a8..945077c161 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -857,6 +857,9 @@ GEM spring (>= 0.9.1) spring-commands-rubocop (0.4.0) spring (>= 1.0) + spring-watcher-listen (2.1.0) + listen (>= 2.7, < 4.0) + spring (>= 4) sprockets (3.7.5) base64 concurrent-ruby (~> 1.0) @@ -1101,6 +1104,7 @@ DEPENDENCIES spring spring-commands-rspec spring-commands-rubocop + spring-watcher-listen sprockets (~> 3.7) state_machines-activerecord stimulus_reflex