google_hash 0.3.1 → 0.4.0
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.
- data/README +1 -3
 - data/VERSION +1 -1
 - data/ext/extconf.rb +10 -15
 - data/ext/go.bat +1 -0
 - data/ext/template/main.cpp.erb +1 -0
 - data/{ext → spec}/scale.rb +1 -1
 - data/spec/spec.google_hash.rb +1 -1
 - metadata +14 -6
 
    
        data/README
    CHANGED
    
    | 
         @@ -54,9 +54,7 @@ Dense is faster, sparse uses less memory. 
     | 
|
| 
       54 
54 
     | 
    
         | 
| 
       55 
55 
     | 
    
         
             
            Installation:
         
     | 
| 
       56 
56 
     | 
    
         | 
| 
       57 
     | 
    
         
            -
            gem install  
     | 
| 
       58 
     | 
    
         
            -
            gem install sane # install a dependency
         
     | 
| 
       59 
     | 
    
         
            -
            gem install google_hash (if on doze, you'll also first need the devkit installed)
         
     | 
| 
      
 57 
     | 
    
         
            +
            gem install google_hash (if on doze, you'll also first need the devkit installed).  You may need rubygems >= 1.3.6
         
     | 
| 
       60 
58 
     | 
    
         | 
| 
       61 
59 
     | 
    
         
             
            Note that if you use a type other than "Ruby" that you will be saving the values away as native values, so they will be using less space than a typical ruby object (which is 20 bytes), using 4 bytes instead of 20 (or instead of 40, in the case of 64 bit machines).  In addition to taking less memory, they are also stored separate from Ruby's heap, meaning that they should release stress on the GC, if you are spending much time in GC.
         
     | 
| 
       62 
60 
     | 
    
         | 
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            0. 
     | 
| 
      
 1 
     | 
    
         
            +
            0.4.0
         
     | 
    
        data/ext/extconf.rb
    CHANGED
    
    | 
         @@ -2,8 +2,8 @@ require 'mkmf' 
     | 
|
| 
       2 
2 
     | 
    
         
             
            require 'erb'
         
     | 
| 
       3 
3 
     | 
    
         
             
            require 'rubygems'
         
     | 
| 
       4 
4 
     | 
    
         
             
            require 'sane'
         
     | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
            # build google's lib locally...
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            # re-build google's lib locally...
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
       8 
8 
     | 
    
         
             
            dir = Dir.pwd
         
     | 
| 
       9 
9 
     | 
    
         
             
            Dir.chdir 'sparsehash-1.5.2' do
         
     | 
| 
         @@ -35,29 +35,24 @@ else 
     | 
|
| 
       35 
35 
     | 
    
         
             
            end
         
     | 
| 
       36 
36 
     | 
    
         | 
| 
       37 
37 
     | 
    
         
             
            ruby_key =  {:convert_keys_from_ruby => "", :convert_keys_to_ruby => "", :key_type => "VALUE", :unreachable_key => "current_instance"} # TODO NULL is false here?
         
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
      
 38 
     | 
    
         
            +
            #long is not useful to us since we don't support BigNum yet
         
     | 
| 
      
 39 
     | 
    
         
            +
            # i.e. long is basically broken till we do
         
     | 
| 
      
 40 
     | 
    
         
            +
            #long_key = {:assert_key_type => 'T_FIXNUM', :convert_keys_from_ruby => "FIX2LONG",
         
     | 
| 
      
 41 
     | 
    
         
            +
            #:convert_keys_to_ruby => "LONG2FIX", :key_type => "long", :unreachable_key => "1<<#{unreachable_int}"}
         
     | 
| 
       40 
42 
     | 
    
         
             
            int_key = {:assert_key_type => 'T_FIXNUM', :convert_keys_from_ruby => "FIX2INT",
         
     | 
| 
       41 
43 
     | 
    
         
             
            :convert_keys_to_ruby => "INT2FIX", :key_type => "int", :unreachable_key => "1<<#{unreachable_int}"}
         
     | 
| 
       42 
44 
     | 
    
         | 
| 
       43 
45 
     | 
    
         | 
| 
       44 
46 
     | 
    
         
             
            ruby_value =  {:value_type => "VALUE"}
         
     | 
| 
       45 
     | 
    
         
            -
            long_value = {:assert_value_type => 'T_FIXNUM', :convert_values_from_ruby => "FIX2LONG",
         
     | 
| 
       46 
     | 
    
         
            -
             
     | 
| 
      
 47 
     | 
    
         
            +
            #long_value = {:assert_value_type => 'T_FIXNUM', :convert_values_from_ruby => "FIX2LONG",
         
     | 
| 
      
 48 
     | 
    
         
            +
            #:convert_values_to_ruby => "LONG2FIX", :value_type => "long"}
         
     | 
| 
       47 
49 
     | 
    
         
             
            int_value = {:assert_value_type => 'T_FIXNUM', :convert_values_from_ruby => "FIX2INT",
         
     | 
| 
       48 
50 
     | 
    
         
             
            :convert_values_to_ruby => "INT2FIX", :value_type => "int"}
         
     | 
| 
       49 
51 
     | 
    
         | 
| 
       50 
     | 
    
         
            -
             
     | 
| 
       51 
     | 
    
         
            -
            long_to_ruby = long_key.merge(ruby_value)
         
     | 
| 
       52 
     | 
    
         
            -
            ruby_to_ruby = ruby_key.merge(ruby_value)
         
     | 
| 
       53 
     | 
    
         
            -
             
     | 
| 
       54 
     | 
    
         
            -
            long_to_long = long_key.merge(long_value)
         
     | 
| 
       55 
     | 
    
         
            -
             
     | 
| 
       56 
52 
     | 
    
         
             
            init_funcs = []
         
     | 
| 
       57 
     | 
    
         
            -
            require 'sane'
         
     | 
| 
       58 
53 
     | 
    
         | 
| 
       59 
     | 
    
         
            -
            for key in [ruby_key,  
     | 
| 
       60 
     | 
    
         
            -
              for value in [ruby_value,  
     | 
| 
      
 54 
     | 
    
         
            +
            for key in [ruby_key, int_key] do
         
     | 
| 
      
 55 
     | 
    
         
            +
              for value in [ruby_value, int_value] do
         
     | 
| 
       61 
56 
     | 
    
         
             
                options = key.merge(value)
         
     | 
| 
       62 
57 
     | 
    
         
             
                for type in ['sparse', 'dense'] do
         
     | 
| 
       63 
58 
     | 
    
         | 
    
        data/ext/go.bat
    CHANGED
    
    
    
        data/ext/template/main.cpp.erb
    CHANGED
    
    
    
        data/{ext → spec}/scale.rb
    RENAMED
    
    
    
        data/spec/spec.google_hash.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,12 +1,13 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification 
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: google_hash
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version 
         
     | 
| 
      
 4 
     | 
    
         
            +
              hash: 15
         
     | 
| 
       4 
5 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       5 
6 
     | 
    
         
             
              segments: 
         
     | 
| 
       6 
7 
     | 
    
         
             
              - 0
         
     | 
| 
       7 
     | 
    
         
            -
              -  
     | 
| 
       8 
     | 
    
         
            -
              -  
     | 
| 
       9 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 8 
     | 
    
         
            +
              - 4
         
     | 
| 
      
 9 
     | 
    
         
            +
              - 0
         
     | 
| 
      
 10 
     | 
    
         
            +
              version: 0.4.0
         
     | 
| 
       10 
11 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       11 
12 
     | 
    
         
             
            authors: 
         
     | 
| 
       12 
13 
     | 
    
         
             
            - rogerdpack
         
     | 
| 
         @@ -14,16 +15,18 @@ autorequire: 
     | 
|
| 
       14 
15 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       15 
16 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       16 
17 
     | 
    
         | 
| 
       17 
     | 
    
         
            -
            date: 2010- 
     | 
| 
      
 18 
     | 
    
         
            +
            date: 2010-07-22 00:00:00 -06:00
         
     | 
| 
       18 
19 
     | 
    
         
             
            default_executable: 
         
     | 
| 
       19 
20 
     | 
    
         
             
            dependencies: 
         
     | 
| 
       20 
21 
     | 
    
         
             
            - !ruby/object:Gem::Dependency 
         
     | 
| 
       21 
22 
     | 
    
         
             
              name: sane
         
     | 
| 
       22 
23 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       23 
24 
     | 
    
         
             
              requirement: &id001 !ruby/object:Gem::Requirement 
         
     | 
| 
      
 25 
     | 
    
         
            +
                none: false
         
     | 
| 
       24 
26 
     | 
    
         
             
                requirements: 
         
     | 
| 
       25 
27 
     | 
    
         
             
                - - ">="
         
     | 
| 
       26 
28 
     | 
    
         
             
                  - !ruby/object:Gem::Version 
         
     | 
| 
      
 29 
     | 
    
         
            +
                    hash: 3
         
     | 
| 
       27 
30 
     | 
    
         
             
                    segments: 
         
     | 
| 
       28 
31 
     | 
    
         
             
                    - 0
         
     | 
| 
       29 
32 
     | 
    
         
             
                    version: "0"
         
     | 
| 
         @@ -44,7 +47,6 @@ files: 
     | 
|
| 
       44 
47 
     | 
    
         
             
            - ext/benchmark.rb
         
     | 
| 
       45 
48 
     | 
    
         
             
            - ext/extconf.rb
         
     | 
| 
       46 
49 
     | 
    
         
             
            - ext/go.bat
         
     | 
| 
       47 
     | 
    
         
            -
            - ext/scale.rb
         
     | 
| 
       48 
50 
     | 
    
         
             
            - ext/sparsehash-1.5.2/AUTHORS
         
     | 
| 
       49 
51 
     | 
    
         
             
            - ext/sparsehash-1.5.2/COPYING
         
     | 
| 
       50 
52 
     | 
    
         
             
            - ext/sparsehash-1.5.2/ChangeLog
         
     | 
| 
         @@ -125,6 +127,7 @@ files: 
     | 
|
| 
       125 
127 
     | 
    
         
             
            - ext/template/google_hash.cpp.erb
         
     | 
| 
       126 
128 
     | 
    
         
             
            - ext/template/main.cpp.erb
         
     | 
| 
       127 
129 
     | 
    
         
             
            - results.txt
         
     | 
| 
      
 130 
     | 
    
         
            +
            - spec/scale.rb
         
     | 
| 
       128 
131 
     | 
    
         
             
            - spec/spec.google_hash.rb
         
     | 
| 
       129 
132 
     | 
    
         
             
            - types.txt
         
     | 
| 
       130 
133 
     | 
    
         
             
            has_rdoc: true
         
     | 
| 
         @@ -137,25 +140,30 @@ rdoc_options: 
     | 
|
| 
       137 
140 
     | 
    
         
             
            require_paths: 
         
     | 
| 
       138 
141 
     | 
    
         
             
            - lib
         
     | 
| 
       139 
142 
     | 
    
         
             
            required_ruby_version: !ruby/object:Gem::Requirement 
         
     | 
| 
      
 143 
     | 
    
         
            +
              none: false
         
     | 
| 
       140 
144 
     | 
    
         
             
              requirements: 
         
     | 
| 
       141 
145 
     | 
    
         
             
              - - ">="
         
     | 
| 
       142 
146 
     | 
    
         
             
                - !ruby/object:Gem::Version 
         
     | 
| 
      
 147 
     | 
    
         
            +
                  hash: 3
         
     | 
| 
       143 
148 
     | 
    
         
             
                  segments: 
         
     | 
| 
       144 
149 
     | 
    
         
             
                  - 0
         
     | 
| 
       145 
150 
     | 
    
         
             
                  version: "0"
         
     | 
| 
       146 
151 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement 
         
     | 
| 
      
 152 
     | 
    
         
            +
              none: false
         
     | 
| 
       147 
153 
     | 
    
         
             
              requirements: 
         
     | 
| 
       148 
154 
     | 
    
         
             
              - - ">="
         
     | 
| 
       149 
155 
     | 
    
         
             
                - !ruby/object:Gem::Version 
         
     | 
| 
      
 156 
     | 
    
         
            +
                  hash: 3
         
     | 
| 
       150 
157 
     | 
    
         
             
                  segments: 
         
     | 
| 
       151 
158 
     | 
    
         
             
                  - 0
         
     | 
| 
       152 
159 
     | 
    
         
             
                  version: "0"
         
     | 
| 
       153 
160 
     | 
    
         
             
            requirements: []
         
     | 
| 
       154 
161 
     | 
    
         | 
| 
       155 
162 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       156 
     | 
    
         
            -
            rubygems_version: 1.3. 
     | 
| 
      
 163 
     | 
    
         
            +
            rubygems_version: 1.3.7
         
     | 
| 
       157 
164 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       158 
165 
     | 
    
         
             
            specification_version: 3
         
     | 
| 
       159 
166 
     | 
    
         
             
            summary: Ruby wrappers to the google hash library
         
     | 
| 
       160 
167 
     | 
    
         
             
            test_files: 
         
     | 
| 
      
 168 
     | 
    
         
            +
            - spec/scale.rb
         
     | 
| 
       161 
169 
     | 
    
         
             
            - spec/spec.google_hash.rb
         
     |