bitfields 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.md +1 -1
- data/lib/bitfields.rb +1 -1
- data/lib/bitfields/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d3c3c80e7c7bc57c3bf5b5d823ed303f2eb9334
|
4
|
+
data.tar.gz: 9d6b4bba6c3d6d32da0c4d973ad73e46895628ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08c481512fb7e297ccf9d9847fa9e2973af42ec178d0209d50a4d826a28921d56b85cd8ea761b3d75726c759057c17c960be852d129cae05c8c7e7f375735c28
|
7
|
+
data.tar.gz: 200eae5fcfb735aa8bc99e45310a0a565a4ed89f35b0de03b78e4eed62f841c571a37fc918c950279bf08ebe1ec2c878264638ab481de8b20b80fc216ec0f0fc
|
data/Readme.md
CHANGED
@@ -63,7 +63,7 @@ TIPS
|
|
63
63
|
|
64
64
|
Query-mode Benchmark
|
65
65
|
=========
|
66
|
-
The `query_mode: :in_list` is slower for most queries and scales
|
66
|
+
The `query_mode: :in_list` is slower for most queries and scales miserably with the number of bits.<br/>
|
67
67
|
*Stay with the default query-mode*. Only use :in_list if your edge-case shows better performance.
|
68
68
|
|
69
69
|
![performance](http://chart.apis.google.com/chart?chtt=bit-operator+vs+IN+--+with+index&chd=s:CEGIKNPRUW,DEHJLOQSVX,CFHKMPSYXZ,DHJMPSVYbe,DHLPRVZbfi,FKOUZeinsx,FLQWbglqw2,HNTZfkqw19,BDEGHJLMOP,BDEGIKLNOQ,BDFGIKLNPQ,BDFGILMNPR,BDFHJKMOQR,BDFHJLMOQS,BDFHJLNPRT,BDFHJLNPRT&chxt=x,y&chxl=0:|100K|200K|300K|400K|500K|600K|700K|800K|900K|1000K|1:|0|1441.671ms&cht=lc&chs=600x500&chdl=2bits+%28in%29|3bits+%28in%29|4bits+%28in%29|6bits+%28in%29|8bits+%28in%29|10bits+%28in%29|12bits+%28in%29|14bits+%28in%29|2bits+%28bit%29|3bits+%28bit%29|4bits+%28bit%29|6bits+%28bit%29|8bits+%28bit%29|10bits+%28bit%29|12bits+%28bit%29|14bits+%28bit%29&chco=0000ff,0000ee,0000dd,0000cc,0000bb,0000aa,000099,000088,ff0000,ee0000,dd0000,cc0000,bb0000,aa0000,990000,880000)
|
data/lib/bitfields.rb
CHANGED
@@ -30,7 +30,7 @@ module Bitfields
|
|
30
30
|
def self.extract_bits(options)
|
31
31
|
bitfields = {}
|
32
32
|
options.keys.select{|key| key.is_a?(Numeric) }.each do |bit|
|
33
|
-
raise "#{bit} is not a power of 2 !!" unless bit
|
33
|
+
raise "#{bit} is not a power of 2 !!" unless bit & (bit - 1) == 0
|
34
34
|
bit_name = options.delete(bit).to_sym
|
35
35
|
raise DuplicateBitNameError if bitfields.include?(bit_name)
|
36
36
|
bitfields[bit_name] = bit
|
data/lib/bitfields/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitfields
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: wwtd
|
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
126
|
rubyforge_project:
|
127
|
-
rubygems_version: 2.
|
127
|
+
rubygems_version: 2.4.5.1
|
128
128
|
signing_key:
|
129
129
|
specification_version: 4
|
130
130
|
summary: Save migrations and columns by storing multiple booleans in a single integer
|