Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

SDK requires slow down app boot considerably #144

@louim

Description

@louim

The current generated SDK load so many files that it slows down our app boot by 3x. I ran a ballpark estimate with find lib -type f | wc -l which got me 20839 files 🤯 . This is only the load time for the app. I started to benchmark after a noticed that our app specs took an abnormal time to run. I'm benchmarking with Hyperfine.

Here's a benchmark of the rails runner to limit the timing to app load.
Here a before run:

git checkout <commit before adding the gem>
bundle install
bin/rails tmp:clear
bin/spring stop

hyperfine --warmup 3 'DISABLE_SPRING=1 bin/rails runner true'

Benchmark 1: DISABLE_SPRING=1 bin/rails runner true
  Time (mean ± σ):      3.857 s ±  0.082 s    [User: 1.576 s, System: 1.292 s]
  Range (min … max):    3.724 s …  3.946 s    10 runs

Here's an after run, showing a 3x increase in load times:

git checkout <commit after adding the gem>
bundle install
bin/rails tmp:clear
bin/spring stop
hyperfine --warmup 3 'DISABLE_SPRING=1 bin/rails runner true'


Benchmark 1: DISABLE_SPRING=1 bin/rails runner true
  Time (mean ± σ):     11.139 s ±  0.124 s    [User: 4.025 s, System: 4.633 s]
  Range (min … max):   10.979 s … 11.360 s    10 runs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions