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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf98d2d12a8005e5ef2755cd6bba97a32122a7dd2514518e9a749d1ba367af00
4
- data.tar.gz: 878a2fab37d90963eb4b4d5924d7b3437847672741471d84ea6cefc686cb7ca1
3
+ metadata.gz: 44f089252dbde289b9e5cfeb25c2613e91544e92a1235369ec7c4457992e477b
4
+ data.tar.gz: c768e54a78cd0ee553f8732f019dc4eab9fff3c5c72d4ef9d30d23abc68b2994
5
5
  SHA512:
6
- metadata.gz: 2baf13ba8db10c35cfaccfaf86b6c966b11555b9b232c1710da044a37dad166f96dee80cdc2380db98321a845c612e80f3a3648dbc515b31f9402a54bc393599
7
- data.tar.gz: b26a83ac5f86fc456c18444e7eba578cb095fa897ee4bac9a508a10047a9164fc8d22197dc0ae6f7f2c7193ca32a437fe1b8fc35c7c9ab873d9091c936be57a0
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
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsMinify
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-minify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sampo Kuokkanen