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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6097ac817e3819beabfa9fc7952395e2d796429505b56654beb9120140535b0a
4
- data.tar.gz: d2c992a82c0691212eb47b262dd016baa46f44cdf1a38b64aaea69c08586fa0b
3
+ metadata.gz: 30a25c15472f0e08070797662ab493401382a73d8375bc3c02b6c918bdeb2f93
4
+ data.tar.gz: 8cce5a94abc9ff8a19c70c62bea012c095a9b8fd4c7fe3af31fea9848393f11d
5
5
  SHA512:
6
- metadata.gz: 443211ad950bbdc1fadc55098abd58c7359e99aed1854dfa6b0949cf1147f7a70fb0816721679036dd2d0ab3a98b4d621e37c25369c80df86d4116939f7b37d2
7
- data.tar.gz: a0ad267400fd14780acbc991eed72ccc1cf70f1aabe4c0ddf75e6f25b9007eba5b2e1415a8d9b04fc605833d8793ed8d6d670b3389f180cb8a1c9752f9992397
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. Part of
4
- [rails-minify](../rails-minify); controller callbacks are in
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 golf-buddy's
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 golf-buddy's controller and integration tests, 34,646 of 34,873 helper
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
- golf-buddy: 999 of 1,080 `render`/`link_to` call sites compile (233 partial
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
- golf-buddy's test suite (4317 runs) gives the same results with both on.
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ApMinimizer
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionpack-minimizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sampo Kuokkanen