You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously reported performance regression #234 was a red herring. The
`Engine` class and addition of adding `app/` asset path appears to be a
big problem, but the reason it's slow is because then it would run
through `precompiled_assets` where without that code it skips
`precompiled_assets` thus skipping the code that is actually slow.
Although `precompiled_assets` was memoized the cache wasn't actually
working and the method cache was being thrown away every single time.
This became very obvious when our test suite (Basecamp) went from 54
seconds to 320 seconds to run on sprockets-rails master.
The problem is that when the env is reset the `precompiled_assets` gets
reset instead of keeping the cache. I moved this method onto the config
to behave like the other methods, for example `assets_manifest`.
Benchmarks:
On a brand new application with a single show test that simply renders a
view with a few assets.
Before this change:
```
Calculating -------------------------------------
Running test... 27.000 i/100ms
-------------------------------------------------
Running test... 305.554 (± 8.2%) i/s - 1.539k
```
After this change:
```
Calculating -------------------------------------
Running test... 55.000 i/100ms
-------------------------------------------------
Running test... 558.135 (± 5.4%) i/s - 2.805k
```
0 commit comments