bootsnap 1.4.2.rc2 → 1.4.2.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/bootsnap/load_path_cache.rb +2 -0
- data/lib/bootsnap/load_path_cache/cache.rb +2 -0
- data/lib/bootsnap/load_path_cache/core_ext/loaded_features.rb +10 -0
- data/lib/bootsnap/load_path_cache/loaded_features_index.rb +9 -0
- data/lib/bootsnap/load_path_cache/path_scanner.rb +3 -1
- data/lib/bootsnap/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38681b872206424d8c9f64e06dcc814feeec7bd252dd987e2b6c9a09a52ab429
|
4
|
+
data.tar.gz: 74d5f5c18d506c5f78ccd33e35dd900a484f41305f955eb9d37499d4c35ca3d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77dc9d0295427aebda3e638c727fac900b2b05babafc73333f6ed30f3a762b1bbff3fdf115baaabc694ab650924a14282bd1920cb0ddab41bfb1c77d4eb3732c
|
7
|
+
data.tar.gz: 07b6b5b65b46aef24bd2ef1d558d774aafa41d09fb6a11b84ca57772d2f6dce81a0cca1df3f11e9e45981986efcbf392b903fd50168ff571a29d8b10eb98084d
|
data/README.md
CHANGED
@@ -33,6 +33,10 @@ Note that bootsnap writes to `tmp/cache`, and that directory *must* be writable.
|
|
33
33
|
boot if it is not. If this is unacceptable (e.g. you are running in a read-only container and
|
34
34
|
unwilling to mount in a writable tmpdir), you should remove this line or wrap it in a conditional.
|
35
35
|
|
36
|
+
**Note also that bootsnap will never clean up its own cache: this is left up to you. Depending on your
|
37
|
+
deployment strategy, you may need to periodically purge `tmp/cache/bootsnap*`. If you notice deploys
|
38
|
+
getting progressively slower, this is almost certainly the cause.**
|
39
|
+
|
36
40
|
It's technically possible to simply specify `gem 'bootsnap', require: 'bootsnap/setup'`, but it's
|
37
41
|
important to load Bootsnap as early as possible to get maximum performance improvement.
|
38
42
|
|
@@ -4,4 +4,14 @@ class << $LOADED_FEATURES
|
|
4
4
|
Bootsnap::LoadPathCache.loaded_features_index.purge(key)
|
5
5
|
delete_without_bootsnap(key)
|
6
6
|
end
|
7
|
+
|
8
|
+
alias_method(:reject_without_bootsnap!, :reject!)
|
9
|
+
def reject!(&block)
|
10
|
+
backup = dup
|
11
|
+
|
12
|
+
# FIXME: if no block is passed we'd need to return a decorated iterator
|
13
|
+
reject_without_bootsnap!(&block)
|
14
|
+
|
15
|
+
Bootsnap::LoadPathCache.loaded_features_index.purge_multi(backup - self)
|
16
|
+
end
|
7
17
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Bootsnap
|
2
4
|
module LoadPathCache
|
3
5
|
# LoadedFeaturesIndex partially mirrors an internal structure in ruby that
|
@@ -55,6 +57,13 @@ module Bootsnap
|
|
55
57
|
end
|
56
58
|
end
|
57
59
|
|
60
|
+
def purge_multi(features)
|
61
|
+
rejected_hashes = features.map(&:hash).to_set
|
62
|
+
@mutex.synchronize do
|
63
|
+
@lfi.reject! { |_, hash| rejected_hashes.include?(hash) }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
58
67
|
def key?(feature)
|
59
68
|
@mutex.synchronize { @lfi.key?(feature) }
|
60
69
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative('../explicit_require')
|
2
4
|
|
3
5
|
module Bootsnap
|
@@ -11,7 +13,7 @@ module Bootsnap
|
|
11
13
|
BUNDLE_PATH = if Bootsnap.bundler?
|
12
14
|
(Bundler.bundle_path.cleanpath.to_s << LoadPathCache::SLASH).freeze
|
13
15
|
else
|
14
|
-
''
|
16
|
+
''
|
15
17
|
end
|
16
18
|
|
17
19
|
def self.call(path)
|
data/lib/bootsnap/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootsnap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.2.
|
4
|
+
version: 1.4.2.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Burke Libbey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -167,7 +167,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
- !ruby/object:Gem::Version
|
168
168
|
version: 1.3.1
|
169
169
|
requirements: []
|
170
|
-
|
170
|
+
rubyforge_project:
|
171
|
+
rubygems_version: 2.7.6
|
171
172
|
signing_key:
|
172
173
|
specification_version: 4
|
173
174
|
summary: Boot large ruby/rails apps faster
|