Skip to content

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

@wojtha

Description

@wojtha

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

  • macOS High Sierra - Darwin mephisto.local 17.7.0 Darwin Kernel Version 17.7.0: Thu Jun 21 22:53:14 PDT 2018; root:xnu-4570.71.2~1/RELEASE_X86_64 x86_64 with OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
  • ruby 2.3.7
  • zeus 0.15.4
  • rails 4.1.16
  • sprockets-rails 2.3.3
  • sprockets 2.12.5

📄 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions