rails-minify 0.1.2 → 0.1.3
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 +16 -0
- data/lib/rails_minify/railtie.rb +12 -0
- data/lib/rails_minify/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: 44f089252dbde289b9e5cfeb25c2613e91544e92a1235369ec7c4457992e477b
|
|
4
|
+
data.tar.gz: c768e54a78cd0ee553f8732f019dc4eab9fff3c5c72d4ef9d30d23abc68b2994
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: da6b92c40d4f1fada0154fb362cd52c8a56e458b67e5d959e20084bb4e37f25a8be93d7d86bc065d6a71ac09dc4763c79fbada65a4f7a73c281c8b9fef511d1b
|
|
7
|
+
data.tar.gz: 8cca5d4c9850e66798cdb80127907dbfc64cdf5643d1064a7ce01be6bfdd8f46b79bbf63e9e8c80775dd6c3453d9877537bd6951707cb434378049fdb0a92227
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.3 (2026-10-18)
|
|
4
|
+
|
|
5
|
+
- `config.rails_minify.zjit = true` turns ZJIT on after boot, as `config.yjit` does for YJIT, instead of `RUBY_ZJIT_ENABLE=1` compiling boot-only code too. Japan Voyage, per process: 24% fewer compiled methods, 18 MB less JIT memory, about 25 MB less RSS, the same speed.
|
|
6
|
+
|
|
3
7
|
## 0.1.2 (2026-10-18)
|
|
4
8
|
|
|
5
9
|
- `minify:check` also fails on callback chains longer than `callback_limit` (default 5, `ApplicationController`'s callbacks excluded) and on model callbacks that save their own record again; `callback_limit_mode` and `callback_loops` set either to `:warn`. Works without the rest of rails-minify turned on; the manifest check runs only when there is a manifest.
|
data/README.md
CHANGED
|
@@ -84,6 +84,22 @@ For parts of Rails and common gems that redo work on every request.
|
|
|
84
84
|
installed when OmniAuth already does this itself (it then has a public
|
|
85
85
|
`Strategy#passthrough?`, as in the version proposed upstream).
|
|
86
86
|
|
|
87
|
+
## ZJIT after boot
|
|
88
|
+
|
|
89
|
+
```ruby
|
|
90
|
+
config.rails_minify.zjit = true # instead of RUBY_ZJIT_ENABLE=1 / --zjit
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`RUBY_ZJIT_ENABLE=1` turns ZJIT on before anything loads, so it also compiles
|
|
94
|
+
what runs only while booting: RubyGems, requiring and eager loading, and the
|
|
95
|
+
minimizers' own compiling. Rails turns YJIT on after boot (`config.yjit`) for
|
|
96
|
+
this reason, but has no such setting for ZJIT; this is that one. It works on
|
|
97
|
+
its own, without the rest of rails-minify.
|
|
98
|
+
|
|
99
|
+
On Japan Voyage, per process after the same 132 pages: 12,612 → 9,557
|
|
100
|
+
compiled methods, JIT code 45.9 → 35.3 MB, ZJIT memory 82.9 → 64.6 MB,
|
|
101
|
+
RSS about 25 MB less, the same CPU time per page.
|
|
102
|
+
|
|
87
103
|
## Numbers
|
|
88
104
|
|
|
89
105
|
Japan Voyage, 132 production pages, with everything on (strict mode after
|
data/lib/rails_minify/railtie.rb
CHANGED
|
@@ -42,6 +42,18 @@ module RailsMinify
|
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
# ZJIT from after boot, as Rails does for YJIT (config.yjit): the code
|
|
46
|
+
# that only runs while booting (requiring, eager loading, the minimizers'
|
|
47
|
+
# compiling) isn't compiled. Japan Voyage, per process: 24% fewer
|
|
48
|
+
# compiled methods, 18 MB less JIT memory, the same speed.
|
|
49
|
+
initializer "rails_minify.zjit" do |app|
|
|
50
|
+
config.after_initialize do
|
|
51
|
+
next unless app.config.rails_minify.zjit && defined?(RubyVM::ZJIT.enable) && !RubyVM::ZJIT.enabled?
|
|
52
|
+
|
|
53
|
+
RubyVM::ZJIT.enable
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
45
57
|
rake_tasks do
|
|
46
58
|
namespace :minify do
|
|
47
59
|
prepare = lambda do
|
data/lib/rails_minify/version.rb
CHANGED