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.
This commit is contained in:
Maikel Linke
2026-03-04 11:45:16 +11:00
parent 59547ba9e4
commit 1bec028a09
2 changed files with 5 additions and 0 deletions

View File

@@ -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'

View File

@@ -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