bootsnap 0.2.12 → 0.2.13
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/README.md +5 -0
- data/bootsnap.gemspec +3 -1
- data/lib/bootsnap/load_path_cache/store.rb +3 -4
- data/lib/bootsnap/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e96b608dfc3efcc29016099867c20525c8c6ab90
|
4
|
+
data.tar.gz: 1b28b0c7a7da530afa65e6ff7a7a9665a3f0688d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b0ebfa2b761317a56ec348ec72f8fa56426f5ebd2f2c9158b951f34408a3d89ac0361cfc1dd00d9556cc9f6c1d722c5db35d80057e54446b894f8047a64f0d5
|
7
|
+
data.tar.gz: d8071f275a597222f975d7791d3f3b4d08b48ee4ed95cc6135f969295716d7518271d3db78742c29a101ac15844c48e99830598865251d00e3db50aea1b74e84
|
data/README.md
CHANGED
@@ -5,6 +5,11 @@
|
|
5
5
|
Bootsnap is a library that plugs into a number of Ruby and (optionally) `ActiveSupport` and `YAML`
|
6
6
|
methods to optimize and cache expensive computations. See [the How Does This Work section](#how-does-this-work) for more information.
|
7
7
|
|
8
|
+
#### Quick Performance Overview
|
9
|
+
- [Discourse](https://github.com/discourse/discourse) reports a boot time reduction of approximately 50%, from roughly 6 to 3 seconds on one machine;
|
10
|
+
- One of our smaller internal apps also sees a reduction of 50%, from 3.6 to 1.8 seconds;
|
11
|
+
- The core Shopify platform -- a rather large monolithic application -- boots about 75% faster, dropping from around 25s to 6.5s.
|
12
|
+
|
8
13
|
## Usage
|
9
14
|
|
10
15
|
Add `bootsnap` to your `Gemfile`:
|
data/bootsnap.gemspec
CHANGED
@@ -23,12 +23,14 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.require_paths = ["lib"]
|
24
24
|
spec.extensions = ['ext/bootsnap/extconf.rb']
|
25
25
|
|
26
|
+
spec.required_ruby_version = '>= 2.3.0'
|
27
|
+
|
26
28
|
spec.add_development_dependency "bundler", '~> 1'
|
27
29
|
spec.add_development_dependency 'rake', '~> 10.0'
|
28
30
|
spec.add_development_dependency 'rake-compiler', '~> 0'
|
29
31
|
spec.add_development_dependency "minitest", "~> 5.0"
|
30
32
|
spec.add_development_dependency "mocha", "~> 1.2"
|
33
|
+
spec.add_development_dependency "ffi-xattr", "~> 0.1.2"
|
31
34
|
|
32
35
|
spec.add_runtime_dependency "msgpack", "~> 1.0"
|
33
|
-
spec.add_runtime_dependency "snappy", "~> 0.0.15"
|
34
36
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
require_relative '../explicit_require'
|
2
2
|
|
3
|
-
Bootsnap::ExplicitRequire.with_gems('snappy') { require 'snappy' }
|
4
3
|
Bootsnap::ExplicitRequire.with_gems('msgpack') { require 'msgpack' }
|
5
4
|
Bootsnap::ExplicitRequire.from_rubylibdir('fileutils')
|
6
5
|
|
@@ -58,8 +57,8 @@ module Bootsnap
|
|
58
57
|
|
59
58
|
def load_data
|
60
59
|
@data = begin
|
61
|
-
MessagePack.load(
|
62
|
-
rescue Errno::ENOENT,
|
60
|
+
MessagePack.load(File.binread(@store_path))
|
61
|
+
rescue Errno::ENOENT, MessagePack::MalformedFormatError
|
63
62
|
{}
|
64
63
|
end
|
65
64
|
end
|
@@ -69,7 +68,7 @@ module Bootsnap
|
|
69
68
|
# caches if they read at an inopportune time.
|
70
69
|
tmp = "#{@store_path}.#{(rand * 100000).to_i}.tmp"
|
71
70
|
FileUtils.mkpath(File.dirname(tmp))
|
72
|
-
File.binwrite(tmp,
|
71
|
+
File.binwrite(tmp, MessagePack.dump(@data))
|
73
72
|
FileUtils.mv(tmp, @store_path)
|
74
73
|
end
|
75
74
|
end
|
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: 0.2.
|
4
|
+
version: 0.2.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Burke Libbey
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -81,33 +81,33 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.2'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: ffi-xattr
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
90
|
-
type: :
|
89
|
+
version: 0.1.2
|
90
|
+
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 0.1.2
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: msgpack
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: '1.0'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: '1.0'
|
111
111
|
description: wip.
|
112
112
|
email:
|
113
113
|
- burke.libbey@shopify.com
|
@@ -157,7 +157,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
157
157
|
requirements:
|
158
158
|
- - ">="
|
159
159
|
- !ruby/object:Gem::Version
|
160
|
-
version:
|
160
|
+
version: 2.3.0
|
161
161
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
162
|
requirements:
|
163
163
|
- - ">="
|