jruby-startup 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -20
- data/lib/jruby/startup/appcds.rb +7 -3
- data/lib/jruby/startup/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d586ea3e5aaf44474a4360c6fe525da30cef4c6e8983fd4041ec3cedf28879b
|
4
|
+
data.tar.gz: 9f68dc24a9b1ee72ed20242a69f7523ae9aa5c0d9e311e32d9cf87a4c13db29d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c737f3446f4a62b90e8bc8db79e90d07859bd0f5e7a3dbb5545c6eddf6b718a0e41348f7641c5e1e0df069e75e56468576e96027ad63c6831c22af63ed8dad0
|
7
|
+
data.tar.gz: '030659741bf3725679bfde76c9599159b8301eece558c617458664a3e51bf79bae49d826b3f54104c556d01b46a1e2ca6ff0104ae8b5f964bee94d2e4b32248f'
|
data/README.md
CHANGED
@@ -1,35 +1,39 @@
|
|
1
|
-
#
|
1
|
+
# JRuby::Startup
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
This is a collection of utilities to help improve the startup time of
|
4
|
+
JRuby-based applications.
|
6
5
|
|
7
6
|
## Installation
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem 'jruby-startup'
|
13
|
-
```
|
14
|
-
|
15
|
-
And then execute:
|
8
|
+
`gem install jruby-startup`
|
16
9
|
|
17
|
-
|
10
|
+
## Usage
|
18
11
|
|
19
|
-
|
12
|
+
The utilities provided by this gem are described below.
|
20
13
|
|
21
|
-
|
14
|
+
### generate-appcds
|
22
15
|
|
23
|
-
|
16
|
+
The `generate-appcds` command is used to generate an AppCDS, or
|
17
|
+
"Application-specific Class Data Store" archive on OpenJDK 11 or
|
18
|
+
higher. This archive pre-processes the classes in JRuby to eliminate
|
19
|
+
some overhead at startup.
|
24
20
|
|
25
|
-
|
21
|
+
By using this utility and setting some environment variables, many
|
22
|
+
JRuby commands can be sped up a fair amount.
|
26
23
|
|
27
|
-
|
24
|
+
Running `generate-appcds` alone will generate the AppCDS archive based
|
25
|
+
on a command line of `-e 1` as passed to JRuby. You can provide a
|
26
|
+
different command line, in quotes, to the `generate-appcds` command.
|
28
27
|
|
29
|
-
|
28
|
+
```
|
29
|
+
$ generate-appcds
|
30
|
+
*** Outputting list of classes at /Users/headius/projects/jruby/lib/jruby.list
|
31
|
+
...
|
32
|
+
```
|
30
33
|
|
31
|
-
|
34
|
+
When the command has completed, you will see some environment variables
|
35
|
+
to set that will enable the use of the AppCDS archive.
|
32
36
|
|
33
37
|
## Contributing
|
34
38
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
39
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/jruby/jruby-startup.
|
data/lib/jruby/startup/appcds.rb
CHANGED
@@ -7,6 +7,10 @@ module JRuby::Startup::AppCDS
|
|
7
7
|
puts "*** Warning: this feature is only supported on Java 11 or higher"
|
8
8
|
end
|
9
9
|
|
10
|
+
if JRUBY_VERSION < '9.2.1.0'
|
11
|
+
puts "*** JRuby 9.2.1 or higher recommended"
|
12
|
+
end
|
13
|
+
|
10
14
|
# Go for it
|
11
15
|
command_line = argv[0] || "-e 1"
|
12
16
|
jruby_home = ENV_JAVA['jruby.home']
|
@@ -27,7 +31,7 @@ module JRuby::Startup::AppCDS
|
|
27
31
|
# Use class list to generate AppCDS archive
|
28
32
|
puts "*** Generating shared AppCDS archive at #{jruby_jsa}"
|
29
33
|
|
30
|
-
fail unless system "VERIFY_JRUBY=1 JAVA_OPTS='-Xshare:dump -XX:+UnlockDiagnosticVMOptions -XX:SharedClassListFile=#{jruby_list} -XX:SharedArchiveFile=#{jruby_jsa}' #{jruby_exe} #{command_line}"
|
34
|
+
fail unless system "VERIFY_JRUBY=1 JAVA_OPTS='-Xshare:dump -XX:G1HeapRegionSize=2m -XX:+UnlockDiagnosticVMOptions -XX:SharedClassListFile=#{jruby_list} -XX:SharedArchiveFile=#{jruby_jsa}' #{jruby_exe} #{command_line}"
|
31
35
|
|
32
36
|
# Display env vars to use for the new archive
|
33
37
|
puts <<~END
|
@@ -35,8 +39,8 @@ module JRuby::Startup::AppCDS
|
|
35
39
|
|
36
40
|
Set the following environment variables to use the shared archive:
|
37
41
|
|
38
|
-
VERIFY_JRUBY=1
|
39
|
-
JAVA_OPTS="-XX
|
42
|
+
VERIFY_JRUBY=1 # Only for JRuby versions 9.2.0.0 or earlier
|
43
|
+
JAVA_OPTS="-XX:G1HeapRegionSize=2m -XX:SharedArchiveFile=#{jruby_jsa}"
|
40
44
|
END
|
41
45
|
end
|
42
46
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jruby-startup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charles Oliver Nutter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|