actionpack-minimizer 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +18 -7
- data/lib/ap_minimizer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 30a25c15472f0e08070797662ab493401382a73d8375bc3c02b6c918bdeb2f93
|
|
4
|
+
data.tar.gz: 8cce5a94abc9ff8a19c70c62bea012c095a9b8fd4c7fe3af31fea9848393f11d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1652dfba848e876c3523c12714af2108a684762afe7f88ae0b48bdecab788c5bbfd97bbcc99dafb11801dc2bca1d3fbfcc21d1082d9a876d1ac904eeebe03923
|
|
7
|
+
data.tar.gz: 2bb312875b427ce8b47ff8d475b8cf927b71a2d82ad79f778661ffdae6c5c5c9e8e39020010b7421347913e2b2766e4227e65d0a7bb461a8b4cca13e6194fa60
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0 (2026-10-20)
|
|
4
|
+
|
|
5
|
+
- No longer a dependency of rails-minify: an optional gem. README: experimental, and it needs work (generating before a preloading server forks, a production result) before it's worth turning on. No code changes.
|
|
6
|
+
|
|
3
7
|
## 0.1.0 (2026-10-18)
|
|
4
8
|
|
|
5
9
|
First release.
|
data/README.md
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
# actionpack-minimizer
|
|
2
2
|
|
|
3
|
-
Precompiles named route helpers and the common view helpers.
|
|
4
|
-
[rails-minify](../rails-minify)
|
|
5
|
-
activesupport-minimizer.
|
|
3
|
+
Precompiles named route helpers and the common view helpers. Optional
|
|
4
|
+
alongside [rails-minify](../rails-minify), which configures it only when it's
|
|
5
|
+
in your Gemfile; controller callbacks are in activesupport-minimizer.
|
|
6
|
+
|
|
7
|
+
**Experimental, and it needs work before it's worth turning on.** Route
|
|
8
|
+
helpers are 3-14x faster per call and `render`/`link_to` 2x per page of
|
|
9
|
+
partials in benchmarks, but on [Japan Voyage](https://japanvoyage.jp) in
|
|
10
|
+
production (Falcon, 6 workers, half with it and half without, the same
|
|
11
|
+
traffic for an hour) neither changed view time: a page spends ~30 ms in
|
|
12
|
+
views, and these calls are a small part of it. Generating the helpers and
|
|
13
|
+
compiled templates before a preloading server forks, and a production result
|
|
14
|
+
that shows a difference, come first.
|
|
6
15
|
|
|
7
16
|
```ruby
|
|
8
17
|
# config/environments/production.rb
|
|
@@ -102,11 +111,11 @@ With `default_url_options` returning the locale and a `scope "(:locale)"`
|
|
|
102
111
|
| `trips_path` | 5547 ns | 167 ns |
|
|
103
112
|
|
|
104
113
|
Each helper is a small body calling one shared method. A version with
|
|
105
|
-
specialized branches per helper was 40% faster per call, but with
|
|
114
|
+
specialized branches per helper was 40% faster per call, but with [Japan Voyage](https://japanvoyage.jp)'s
|
|
106
115
|
~1,100 helpers it cost 19 MB and made whole pages 3% slower under YJIT
|
|
107
116
|
(more code to compile and keep in cache), so it's gone.
|
|
108
117
|
|
|
109
|
-
In
|
|
118
|
+
In Japan Voyage's controller and integration tests, 34,646 of 34,873 helper
|
|
110
119
|
calls (99.3%) took the compiled path.
|
|
111
120
|
|
|
112
121
|
A page rendering 50 partials with two `link_to` each (`bench/views.rb`):
|
|
@@ -118,11 +127,13 @@ per link, 4.4 → 1.1 µs with YJIT. With a computed class: 7.3 → 2.5 µs,
|
|
|
118
127
|
|
|
119
128
|
Single-record `render @comment`: 4.9 → 2.6 µs, 10.3 → 5.0 µs without YJIT.
|
|
120
129
|
|
|
121
|
-
|
|
130
|
+
Japan Voyage: 999 of 1,080 `render`/`link_to` call sites compile (233 partial
|
|
122
131
|
renders, 149 record renders, of which collections and components take Rails'
|
|
123
132
|
path at runtime, 375 `link_to`, 242 block-form `link_to`: all of them).
|
|
124
133
|
|
|
125
|
-
|
|
134
|
+
Japan Voyage's test suite (4317 runs) gives the same results with both on.
|
|
135
|
+
In production there, route helpers and views each made no difference in view
|
|
136
|
+
time.
|
|
126
137
|
|
|
127
138
|
Note: with eager loading, Rails frees each route's AST once routes are
|
|
128
139
|
finalized, so `Route#glob?` raises afterwards; glob status is recorded when
|
data/lib/ap_minimizer/version.rb
CHANGED