bootsnap 0.2.15 → 0.3.0.pre2
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 +5 -0
- data/README.md +33 -27
- data/ext/bootsnap/bootsnap.c +555 -394
- data/ext/bootsnap/bootsnap.h +1 -3
- data/lib/bootsnap/compile_cache/iseq.rb +7 -1
- data/lib/bootsnap/compile_cache/yaml.rb +2 -1
- data/lib/bootsnap/compile_cache.rb +3 -3
- data/lib/bootsnap/version.rb +1 -1
- data/lib/bootsnap.rb +1 -0
- metadata +4 -4
data/ext/bootsnap/bootsnap.h
CHANGED
|
@@ -4,6 +4,10 @@ require 'zlib'
|
|
|
4
4
|
module Bootsnap
|
|
5
5
|
module CompileCache
|
|
6
6
|
module ISeq
|
|
7
|
+
class << self
|
|
8
|
+
attr_accessor :cache_dir
|
|
9
|
+
end
|
|
10
|
+
|
|
7
11
|
def self.input_to_storage(_, path)
|
|
8
12
|
RubyVM::InstructionSequence.compile_file(path).to_binary
|
|
9
13
|
rescue SyntaxError
|
|
@@ -28,6 +32,7 @@ module Bootsnap
|
|
|
28
32
|
module InstructionSequenceMixin
|
|
29
33
|
def load_iseq(path)
|
|
30
34
|
Bootsnap::CompileCache::Native.fetch(
|
|
35
|
+
Bootsnap::CompileCache::ISeq.cache_dir,
|
|
31
36
|
path.to_s,
|
|
32
37
|
Bootsnap::CompileCache::ISeq
|
|
33
38
|
)
|
|
@@ -62,7 +67,8 @@ module Bootsnap
|
|
|
62
67
|
Bootsnap::CompileCache::Native.compile_option_crc32 = crc
|
|
63
68
|
end
|
|
64
69
|
|
|
65
|
-
def self.install!
|
|
70
|
+
def self.install!(cache_dir)
|
|
71
|
+
Bootsnap::CompileCache::ISeq.cache_dir = cache_dir
|
|
66
72
|
Bootsnap::CompileCache::ISeq.compile_option_updated
|
|
67
73
|
class << RubyVM::InstructionSequence
|
|
68
74
|
prepend InstructionSequenceMixin
|
|
@@ -30,7 +30,7 @@ module Bootsnap
|
|
|
30
30
|
::YAML.load(data)
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
def self.install!
|
|
33
|
+
def self.install!(cache_dir)
|
|
34
34
|
require 'yaml'
|
|
35
35
|
require 'msgpack'
|
|
36
36
|
|
|
@@ -44,6 +44,7 @@ module Bootsnap
|
|
|
44
44
|
klass = class << ::YAML; self; end
|
|
45
45
|
klass.send(:define_method, :load_file) do |path|
|
|
46
46
|
Bootsnap::CompileCache::Native.fetch(
|
|
47
|
+
cache_dir,
|
|
47
48
|
path.to_s,
|
|
48
49
|
Bootsnap::CompileCache::YAML
|
|
49
50
|
)
|
|
@@ -3,13 +3,13 @@ require_relative 'compile_cache/yaml'
|
|
|
3
3
|
|
|
4
4
|
module Bootsnap
|
|
5
5
|
module CompileCache
|
|
6
|
-
def self.setup(iseq:, yaml:)
|
|
6
|
+
def self.setup(cache_dir:, iseq:, yaml:)
|
|
7
7
|
if iseq
|
|
8
|
-
Bootsnap::CompileCache::ISeq.install!
|
|
8
|
+
Bootsnap::CompileCache::ISeq.install!(cache_dir)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
if yaml
|
|
12
|
-
Bootsnap::CompileCache::YAML.install!
|
|
12
|
+
Bootsnap::CompileCache::YAML.install!(cache_dir)
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
15
|
end
|
data/lib/bootsnap/version.rb
CHANGED
data/lib/bootsnap.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.
|
|
4
|
+
version: 0.3.0.pre2
|
|
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-05-
|
|
11
|
+
date: 2017-05-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -162,9 +162,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
162
162
|
version: 2.3.0
|
|
163
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
requirements:
|
|
165
|
-
- - "
|
|
165
|
+
- - ">"
|
|
166
166
|
- !ruby/object:Gem::Version
|
|
167
|
-
version:
|
|
167
|
+
version: 1.3.1
|
|
168
168
|
requirements: []
|
|
169
169
|
rubyforge_project:
|
|
170
170
|
rubygems_version: 2.6.10
|