faster_rubygems 0.12.2 → 0.12.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README +43 -25
- data/VERSION +1 -1
- data/benchmarks.txt +0 -2
- data/lib/faster_rubygems/prelude_cached_load.rb +1 -1
- data/spec/spec.uses_cache_files.rb +2 -0
- metadata +3 -3
data/README
CHANGED
@@ -1,10 +1,46 @@
|
|
1
1
|
= Faster Rubygems =
|
2
2
|
|
3
|
-
A helper gem to dramatically speedup the time it takes to startup a ruby script.
|
4
3
|
|
5
|
-
|
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
|
+
|
41
|
+
|
42
|
+
with mingw (windows).
|
6
43
|
|
7
|
-
Speed difference (a demo gem script, ruby 1.8 windows mingw):
|
8
44
|
|
9
45
|
normal rubygems:
|
10
46
|
|
@@ -16,25 +52,10 @@ with faster_rubygems:
|
|
16
52
|
$ timer ruby whichr
|
17
53
|
0.19s
|
18
54
|
|
19
|
-
Yea!
|
20
|
-
|
21
|
-
It acts like a beefed up version of gem_prelude (prelude is 1.9 only currently), with a bit more cacheing thrown in there.
|
22
|
-
|
23
|
-
It makes even more of a difference when used with 1.9 on windows:
|
24
|
-
|
25
|
-
normal rubygems:
|
26
|
-
|
27
|
-
$ timer ruby whichr
|
28
|
-
3.8s
|
29
|
-
|
30
|
-
with faster_rubygems:
|
31
|
-
|
32
|
-
$ timer ruby whichr
|
33
|
-
0.24s
|
34
55
|
|
35
56
|
== installation ==
|
36
57
|
|
37
|
-
$ gem install faster_rubygems
|
58
|
+
$ gem install faster_rubygems # installs faster_rubygems into your site lib, overrides normal rubygems
|
38
59
|
|
39
60
|
now there is a manual step that must be followed:
|
40
61
|
|
@@ -63,19 +84,16 @@ See http://github.com/rdp/faster_rubygems/blob/master/benchmarks.txt for a full
|
|
63
84
|
== Trouble Shooting ==
|
64
85
|
|
65
86
|
# if you wish to revert back to normal rubygems, do the following:
|
66
|
-
|
67
|
-
>> require 'faster_rubygems/unoverride'
|
87
|
+
$ faster_rubygems --unoverride
|
68
88
|
|
69
89
|
If all else fails in this process (it has typically worked fine), you can
|
70
90
|
reinstall normal rubygems by downloading its package (.tgz) and running ruby setup.rb within it.
|
71
91
|
|
72
|
-
|
73
92
|
To regenerate cache files (should never really be necessary, but if you for some reason think yours are stale) do the following:
|
74
93
|
|
75
|
-
|
76
|
-
>> require 'faster_rubygems/create_cache_for_all'
|
94
|
+
$ faster_rubygems # by default it recaches what it can
|
77
95
|
|
78
|
-
Most of the credit for this gem goes to gem prelude.
|
96
|
+
Most of the credit for this gem goes to gem prelude and some ideas by Charles Nutter.
|
79
97
|
|
80
98
|
== Related projects ==
|
81
99
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.12.
|
1
|
+
0.12.5
|
data/benchmarks.txt
CHANGED
@@ -21,7 +21,7 @@ module Gem
|
|
21
21
|
raise if AllCaches.empty? # should never be empty...
|
22
22
|
AllCaches.each{|path, gem_list|
|
23
23
|
for gem_name, long_file_list in gem_list
|
24
|
-
if long_file_list[sub_lib
|
24
|
+
if long_file_list[sub_lib]
|
25
25
|
puts 'activating' + gem_name + ' ' + sub_lib.to_s if $DEBUG
|
26
26
|
if gem(gem_name)
|
27
27
|
puts 'gem activated ' + gem_name + ' ' + sub_lib if $VERBOSE || $DEBUG
|
@@ -102,6 +102,8 @@ describe 'can create cache file apropo' do
|
|
102
102
|
create_file true
|
103
103
|
end
|
104
104
|
|
105
|
+
it 'should work with capitalized like RMagick -> Magick'
|
106
|
+
|
105
107
|
it "should create the caches on install/uninstall" do
|
106
108
|
FileUtils.rm_rf Gem.path[0] + "/.faster_rubygems_cache"
|
107
109
|
Gem.create_cache_for_all!
|
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: 37
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 12
|
9
|
-
-
|
10
|
-
version: 0.12.
|
9
|
+
- 5
|
10
|
+
version: 0.12.5
|
11
11
|
platform: ruby
|
12
12
|
authors: []
|
13
13
|
|