burke / zeus

Boot any rails app in under a second.
MIT License
3.33k stars 231 forks source link

Rails assets are loading veeeery slow (45s+) with zeus when config.assets.debug = true #663

Open wojtha opened 5 years ago

wojtha commented 5 years ago

Description of Problem

After upgrade from El Capitan to macOS High Sierra (and enabling export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES) the rails server in development mode behaves differently. With config.assets.debug = true and two dozens of asset files, EVERY page load takes 45-60 secs CPU usage of zeus process is very high until all assets are rendered. I seems that assets are compiled again and again during each request. When I run the server without zeus it takes 2-3 secs. Setting config.assets.debug = false makes the page loading time to be sane again but it complicates the frontend development so it is not a long term solution.

System details

📄 zeus.json 📄 custom_plan.rb

Steps to Reproduce

# development.rb
config.cache_classes = false
config.eager_load = false
config.serve_static_assets = true
config.assets.debug = true

Observed Behavior

Loading assets with config.assets.debug = true is veeeery slow (45 sec and even more).

zeus start
zeus s

image

Expected Behavior

Loading assets with config.assets.debug = true is fast as via rails server (2-4 sec)

bundle exec rails s

inlinemanual com 2018-09-14 13-11-58

Short term workaround

Set config.assets.debug = false and do not use zeus server for frontend assets development.

zeus start
zeus s

image