faster_rubygems 0.12.5 → 0.12.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README +47 -37
- data/VERSION +1 -1
- data/benchmarks.txt +87 -81
- data/lib/rubygems_plugin.rb +8 -4
- metadata +4 -4
data/README
CHANGED
@@ -1,42 +1,42 @@
|
|
1
1
|
= Faster Rubygems =
|
2
2
|
|
3
3
|
|
4
|
-
|
5
|
-
This gem makes loading rubygems *much* faster.
|
6
|
-
|
7
|
-
What it does is cache the location of files in your gem dirs, ex:
|
8
|
-
|
9
|
-
/lib/ruby/gems/1.8/jruby/{active_support, active_record}
|
10
|
-
|
11
|
-
it creates this file:
|
12
|
-
|
13
|
-
/lib/ruby/gems/1.8/jruby/.faster_rubygems_cache
|
14
|
-
|
15
|
-
Then it uses *that* instead of loading full blown rubygems.
|
16
|
-
|
17
|
-
|
18
|
-
Timing (on doze with ~ 50 gems installed):
|
19
|
-
|
20
|
-
no rubygems at all:
|
21
|
-
|
22
|
-
$ jruby -e 1
|
23
|
-
0.68s.
|
24
|
-
|
25
|
-
require 'rubygems' time:
|
26
|
-
|
27
|
-
$ jruby -rubygems -e 1
|
28
|
-
|
29
|
-
2.36s normal rubygems: -> 0.94s with faster_rubygems
|
30
|
-
|
31
|
-
time to do a rake -V (get rake version):
|
32
|
-
|
33
|
-
$ jruby -S rake -V
|
34
|
-
|
35
|
-
2.48s with normal rubygems: -> 1.50s with faster_rubygems
|
36
|
-
|
37
|
-
(rake installed into site_ruby and loaded without rubygems takes 1.41s).
|
38
|
-
|
39
|
-
Thus we see that loading of rubygems has decreased from 1.4s to between 0.1s and 0.3s
|
4
|
+
|
5
|
+
This gem makes loading rubygems *much* faster.
|
6
|
+
|
7
|
+
What it does is cache the location of files in your gem dirs, ex:
|
8
|
+
|
9
|
+
/lib/ruby/gems/1.8/jruby/{active_support, active_record}
|
10
|
+
|
11
|
+
it creates this file:
|
12
|
+
|
13
|
+
/lib/ruby/gems/1.8/jruby/.faster_rubygems_cache
|
14
|
+
|
15
|
+
Then it uses *that* instead of loading full blown rubygems.
|
16
|
+
|
17
|
+
|
18
|
+
Timing (on doze with ~ 50 gems installed):
|
19
|
+
|
20
|
+
no rubygems at all:
|
21
|
+
|
22
|
+
$ jruby -e 1
|
23
|
+
0.68s.
|
24
|
+
|
25
|
+
require 'rubygems' time:
|
26
|
+
|
27
|
+
$ jruby -rubygems -e 1
|
28
|
+
|
29
|
+
2.36s normal rubygems: -> 0.94s with faster_rubygems
|
30
|
+
|
31
|
+
time to do a rake -V (get rake version):
|
32
|
+
|
33
|
+
$ jruby -S rake -V
|
34
|
+
|
35
|
+
2.48s with normal rubygems: -> 1.50s with faster_rubygems
|
36
|
+
|
37
|
+
(rake installed into site_ruby and loaded without rubygems takes 1.41s).
|
38
|
+
|
39
|
+
Thus we see that loading of rubygems has decreased from 1.4s to between 0.1s and 0.3s
|
40
40
|
|
41
41
|
|
42
42
|
with mingw (windows).
|
@@ -53,6 +53,14 @@ with faster_rubygems:
|
|
53
53
|
0.19s
|
54
54
|
|
55
55
|
|
56
|
+
linux:
|
57
|
+
|
58
|
+
$ time ruby -S whichr whichr
|
59
|
+
ruby 1.9: 0.6s -> 0.13s
|
60
|
+
ruby 1.8: 0.17s -> 0.09s
|
61
|
+
|
62
|
+
Thus we see that it helps startup time for 1.9 on Linux, but not much for 1.8 on Linux.
|
63
|
+
|
56
64
|
== installation ==
|
57
65
|
|
58
66
|
$ gem install faster_rubygems # installs faster_rubygems into your site lib, overrides normal rubygems
|
@@ -70,6 +78,7 @@ now there is a manual step that must be followed:
|
|
70
78
|
|
71
79
|
Note that full rubygems will still be loaded when necessary (for example when installing new gems). This is automatic.
|
72
80
|
|
81
|
+
Also note that using this reduces the memory footprint of your application by not having to load full rubygems, with its files and accompanying gemspecs, which are traditionally all re-loaded every time, but not with faster_rubygems.
|
73
82
|
|
74
83
|
== Rails ==
|
75
84
|
|
@@ -102,7 +111,8 @@ http://github.com/fabien/minigems/tree/master
|
|
102
111
|
1.9's gem_prelude
|
103
112
|
http://www.ruby-forum.com/topic/191673
|
104
113
|
the Builder gem
|
114
|
+
http://github.com/jeremyevans/zozo
|
105
115
|
|
106
116
|
Source/feedback:
|
107
117
|
|
108
|
-
http://www.github.com/rdp/faster_rubygems
|
118
|
+
http://www.github.com/rdp/faster_rubygems
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.12.
|
1
|
+
0.12.6
|
data/benchmarks.txt
CHANGED
@@ -1,92 +1,98 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
mingw 1.8
|
1
|
+
|
2
|
+
benchmarks runing [$ whichr whichr] (the whichr gem just behaves like the "which" command in Linux), best time seen:
|
3
|
+
|
4
|
+
mingw 1.8
|
6
5
|
|
7
6
|
normal rubygems
|
8
7
|
0.77
|
9
8
|
|
10
9
|
faster_rubygems with cache
|
11
|
-
0.14
|
12
|
-
|
13
|
-
faster_rubygems without cache:
|
10
|
+
0.14
|
11
|
+
|
12
|
+
faster_rubygems without cache:
|
14
13
|
0.20
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
|
15
|
+
(on an older computer with 1.8 1s -> 0.3s)
|
16
|
+
|
17
|
+
mingw 1.9
|
18
|
+
|
18
19
|
normal rubygems:
|
19
20
|
3.79
|
20
21
|
|
21
22
|
faster_rubygems with cache:
|
22
|
-
0.19
|
23
|
-
|
24
|
-
faster_rubygems without cache:
|
25
|
-
0.50
|
26
|
-
|
27
|
-
jruby, 1.8 mode
|
28
|
-
|
29
|
-
normal rubygems:
|
30
|
-
2.31
|
31
|
-
|
32
|
-
faster_rubygems without cache (deleted the cache file temporarily to force it to not use it):
|
33
|
-
1.15
|
34
|
-
|
35
|
-
faster_rubygems with cache:
|
36
|
-
1.11
|
37
|
-
|
38
|
-
|
39
|
-
rails 2.3.8 [ $ ruby script\runner -e production "puts 3" ]
|
40
|
-
Unfortunately rails requires a load of full rubygems. So currently faster_rubygems doesn't help it much.
|
41
|
-
|
42
|
-
faster_require (other gem) seems to help, however.
|
43
|
-
|
44
|
-
1.9
|
45
|
-
normal gem_prelude[RUBYOPT=]
|
46
|
-
20.85
|
47
|
-
|
48
|
-
faster_rubygems without cache [RUBYOPT=-rfaster_rubygems]
|
49
|
-
20.7
|
50
|
-
|
51
|
-
faster_rubygems with cache [RUBYOPT=-rfaster_rubygems --disable-gems]:
|
52
|
-
12.10
|
53
|
-
|
54
|
-
normal gem_prelude, with faster_require gem [RUBYOPT=-rfaster_require]:
|
55
|
-
8.93
|
56
|
-
|
57
|
-
faster_rubygems, without cache, with faster_require [RUBYOPT=-rfaster_rubygems -rfaster_require]:
|
58
|
-
8.99
|
59
|
-
|
60
|
-
* recommend this configuration for ruby 1.9 and rails.
|
61
|
-
|
62
|
-
faster_rubygems, with cache [RUBYOPT=--disable-gems -rfaster_rubygems -rfaster_require]
|
63
|
-
fail (gotta fix that, then will probably be fastest option)
|
64
|
-
|
65
|
-
1.8
|
66
|
-
|
67
|
-
normal rubygems:
|
68
|
-
6.54
|
69
|
-
|
70
|
-
faster_rubygems without cache:
|
71
|
-
6.12
|
72
|
-
|
73
|
-
faster_rubygems with cache:
|
74
|
-
6.48
|
75
|
-
|
76
|
-
normal rubygems, faster_require:
|
77
|
-
3.53
|
78
|
-
|
79
|
-
faster_rubygems with cache and with faster_require (have to use it as require 'faster_require')
|
80
|
-
2.97
|
81
|
-
|
82
|
-
* recommend this configuration, which means you'll have to add a require 'faster_require' to your rails script at the beginning, like in boot.rb
|
83
|
-
|
84
|
-
faster_rubygems without cache and with faster_require
|
85
|
-
3.31
|
86
|
-
|
87
|
-
|
88
|
-
|
23
|
+
0.19
|
24
|
+
|
25
|
+
faster_rubygems without cache:
|
26
|
+
0.50
|
27
|
+
|
28
|
+
jruby, 1.8 mode
|
29
|
+
|
30
|
+
normal rubygems:
|
31
|
+
2.31
|
32
|
+
|
33
|
+
faster_rubygems without cache (deleted the cache file temporarily to force it to not use it):
|
34
|
+
1.15
|
35
|
+
|
36
|
+
faster_rubygems with cache:
|
37
|
+
1.11
|
38
|
+
|
39
|
+
|
40
|
+
rails 2.3.8 [ $ ruby script\runner -e production "puts 3" ]
|
41
|
+
Unfortunately rails requires a load of full rubygems. So currently faster_rubygems doesn't help it much.
|
42
|
+
|
43
|
+
faster_require (other gem) seems to help, however.
|
44
|
+
|
45
|
+
1.9
|
46
|
+
normal gem_prelude[RUBYOPT=]
|
47
|
+
20.85
|
48
|
+
|
49
|
+
faster_rubygems without cache [RUBYOPT=-rfaster_rubygems]
|
50
|
+
20.7
|
51
|
+
|
52
|
+
faster_rubygems with cache [RUBYOPT=-rfaster_rubygems --disable-gems]:
|
53
|
+
12.10
|
54
|
+
|
55
|
+
normal gem_prelude, with faster_require gem [RUBYOPT=-rfaster_require]:
|
56
|
+
8.93
|
57
|
+
|
58
|
+
faster_rubygems, without cache, with faster_require [RUBYOPT=-rfaster_rubygems -rfaster_require]:
|
59
|
+
8.99
|
60
|
+
|
61
|
+
* recommend this configuration for ruby 1.9 and rails.
|
62
|
+
|
63
|
+
faster_rubygems, with cache [RUBYOPT=--disable-gems -rfaster_rubygems -rfaster_require]
|
64
|
+
fail (gotta fix that, then will probably be fastest option)
|
65
|
+
|
66
|
+
1.8
|
67
|
+
|
68
|
+
normal rubygems:
|
69
|
+
6.54
|
70
|
+
|
71
|
+
faster_rubygems without cache:
|
72
|
+
6.12
|
73
|
+
|
74
|
+
faster_rubygems with cache:
|
75
|
+
6.48
|
76
|
+
|
77
|
+
normal rubygems, faster_require:
|
78
|
+
3.53
|
79
|
+
|
80
|
+
faster_rubygems with cache and with faster_require (have to use it as require 'faster_require')
|
81
|
+
2.97
|
82
|
+
|
83
|
+
* recommend this configuration, which means you'll have to add a require 'faster_require' to your rails script at the beginning, like in boot.rb
|
84
|
+
|
85
|
+
faster_rubygems without cache and with faster_require
|
86
|
+
3.31
|
87
|
+
|
88
|
+
jruby linux:
|
89
|
+
$ jruby -S whichr whichr
|
90
|
+
2.35s -> 1.5s
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
TODO:
|
89
95
|
jruby spawning itself was *so slow* it seemed (timer.rb)
|
90
|
-
only regenerate appropriate cache files after gem installs...I guess.
|
91
|
-
only cache lib filenames, not spec files, et al...
|
92
|
-
chmod after create (check if necessary first)
|
96
|
+
only regenerate appropriate cache files after gem installs...I guess.
|
97
|
+
only cache lib filenames, not spec files, et al...
|
98
|
+
chmod after create (check if necessary first)
|
data/lib/rubygems_plugin.rb
CHANGED
@@ -1,13 +1,17 @@
|
|
1
1
|
Gem.post_install {
|
2
2
|
# accomodate for when they install more than one at a time...
|
3
3
|
# a straight require won't cut it...
|
4
|
-
|
5
|
-
|
4
|
+
@recreate_proc ||= at_exit {
|
5
|
+
print 'because of new gem installation '
|
6
|
+
load "faster_rubygems/create_cache_for_all.rb"
|
7
|
+
}
|
6
8
|
}
|
7
9
|
|
8
10
|
Gem.post_uninstall {
|
9
|
-
|
10
|
-
|
11
|
+
@recreate_proc ||= at_exit {
|
12
|
+
print 'because of gem uninstallation '
|
13
|
+
load "faster_rubygems/create_cache_for_all.rb"
|
14
|
+
}
|
11
15
|
}
|
12
16
|
|
13
17
|
Gem.pre_uninstall { |gem_installer_instance|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faster_rubygems
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 35
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 12
|
9
|
-
-
|
10
|
-
version: 0.12.
|
9
|
+
- 6
|
10
|
+
version: 0.12.6
|
11
11
|
platform: ruby
|
12
12
|
authors: []
|
13
13
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-07-
|
18
|
+
date: 2010-07-06 00:00:00 -06:00
|
19
19
|
default_executable: faster_rubygems
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|