readthis 0.8.1 → 1.0.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.
- checksums.yaml +4 -4
- data/README.md +31 -9
- data/lib/active_support/cache/readthis_store.rb +1 -1
- data/lib/readthis/cache.rb +24 -29
- data/lib/readthis/entity.rb +120 -28
- data/lib/readthis/expanders.rb +1 -1
- data/lib/readthis/serializers.rb +111 -0
- data/lib/readthis/version.rb +1 -1
- data/lib/readthis.rb +6 -0
- data/spec/readthis/cache_spec.rb +68 -20
- data/spec/readthis/entity_spec.rb +69 -12
- data/spec/readthis/expanders_spec.rb +1 -1
- data/spec/readthis/serializers_spec.rb +87 -0
- data/spec/readthis_spec.rb +9 -0
- data/spec/spec_helper.rb +1 -3
- metadata +23 -24
- data/.gitignore +0 -15
- data/.rspec +0 -2
- data/.travis.yml +0 -15
- data/CHANGELOG.md +0 -114
- data/CONTRIBUTING.md +0 -14
- data/Gemfile +0 -14
- data/LICENSE.txt +0 -22
- data/PERFORMANCE.md +0 -73
- data/Rakefile +0 -2
- data/benchmarks/compressed.rb +0 -74
- data/benchmarks/driver.rb +0 -18
- data/benchmarks/marshalling.rb +0 -40
- data/benchmarks/memory.rb +0 -11
- data/benchmarks/multi.rb +0 -64
- data/benchmarks/profile.rb +0 -20
- data/bin/rspec +0 -16
- data/lib/readthis/notifications.rb +0 -7
- data/readthis.gemspec +0 -27
- data/spec/readthis/notifications_spec.rb +0 -15
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'readthis
|
1
|
+
require 'readthis'
|
2
2
|
require 'json'
|
3
3
|
|
4
4
|
RSpec.describe Readthis::Entity do
|
@@ -7,14 +7,21 @@ RSpec.describe Readthis::Entity do
|
|
7
7
|
string = 'some string'
|
8
8
|
entity = Readthis::Entity.new
|
9
9
|
|
10
|
-
expect(entity.dump(string)).to
|
10
|
+
expect(entity.dump(string)).to include(Marshal.dump(string))
|
11
11
|
end
|
12
12
|
|
13
13
|
it 'marshals using a custom marshaller' do
|
14
14
|
string = 'some string'
|
15
15
|
entity = Readthis::Entity.new(marshal: JSON)
|
16
16
|
|
17
|
-
expect(entity.dump(string)).to
|
17
|
+
expect(entity.dump(string)).to include(JSON.dump(string))
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'overrides the marshaller' do
|
21
|
+
string = 'still some string'
|
22
|
+
entity = Readthis::Entity.new
|
23
|
+
|
24
|
+
expect(entity.dump(string, marshal: JSON)).to include(JSON.dump(string))
|
18
25
|
end
|
19
26
|
|
20
27
|
it 'applies compression when enabled' do
|
@@ -39,6 +46,22 @@ RSpec.describe Readthis::Entity do
|
|
39
46
|
expect(entity.load(string)).to eq(string)
|
40
47
|
end
|
41
48
|
|
49
|
+
it 'overrides the compression threshold' do
|
50
|
+
string = 'a' * 8
|
51
|
+
entity = Readthis::Entity.new(compress: true, threshold: 2)
|
52
|
+
dumped = entity.dump(string)
|
53
|
+
|
54
|
+
expect(entity.dump(string, threshold: 100)).not_to eq(dumped)
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'overrides the compression option' do
|
58
|
+
string = 'a' * 8
|
59
|
+
entity = Readthis::Entity.new(compress: true, threshold: 2)
|
60
|
+
dumped = entity.dump(string)
|
61
|
+
|
62
|
+
expect(entity.dump(string, compress: false)).not_to eq(dumped)
|
63
|
+
end
|
64
|
+
|
42
65
|
it 'safely roundtrips nil values' do
|
43
66
|
entity = Readthis::Entity.new
|
44
67
|
|
@@ -49,26 +72,27 @@ RSpec.describe Readthis::Entity do
|
|
49
72
|
describe '#load' do
|
50
73
|
it 'unmarshals a value' do
|
51
74
|
object = { a: 1, b: '2' }
|
52
|
-
dumped = Marshal.dump(object)
|
53
75
|
entity = Readthis::Entity.new
|
76
|
+
dumped = entity.dump(object)
|
54
77
|
|
55
78
|
expect(entity.load(dumped)).to eq(object)
|
56
79
|
end
|
57
80
|
|
58
81
|
it 'uncompresses when compression is enabled' do
|
59
82
|
string = 'another one of those huge strings'
|
60
|
-
entity = Readthis::Entity.new(compress: true, threshold:
|
61
|
-
dumped =
|
62
|
-
|
63
|
-
compressed = entity.compress(dumped)
|
83
|
+
entity = Readthis::Entity.new(compress: true, threshold: 4)
|
84
|
+
dumped = entity.dump(dumped)
|
64
85
|
|
65
|
-
expect(entity.load(
|
86
|
+
expect(entity.load(dumped)).not_to eq(string)
|
66
87
|
end
|
67
88
|
|
68
|
-
it '
|
69
|
-
|
89
|
+
it 'uses the dumped value to define load options' do
|
90
|
+
value = [1, 2, 3]
|
91
|
+
custom = Readthis::Entity.new(marshal: JSON, compress: true)
|
92
|
+
general = Readthis::Entity.new(marshal: Marshal, compress: false)
|
93
|
+
dumped = custom.dump(value)
|
70
94
|
|
71
|
-
expect(
|
95
|
+
expect(general.load(dumped)).to eq(value)
|
72
96
|
end
|
73
97
|
|
74
98
|
it 'passes through the value when it fails to marshal' do
|
@@ -84,4 +108,37 @@ RSpec.describe Readthis::Entity do
|
|
84
108
|
expect { entity.load(dumped) }.not_to raise_error
|
85
109
|
end
|
86
110
|
end
|
111
|
+
|
112
|
+
describe '#compose' do
|
113
|
+
it 'prepends the string with a formatted marker' do
|
114
|
+
string = 'the quick brown fox'
|
115
|
+
marked = Readthis::Entity.new.compose(string, Marshal, true)
|
116
|
+
|
117
|
+
expect(marked[0]).not_to eq('t')
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
describe '#decompose' do
|
122
|
+
it 'returns extracted options and values' do
|
123
|
+
string = 'the quick brown fox'
|
124
|
+
entity = Readthis::Entity.new
|
125
|
+
marked = entity.compose(string.dup, JSON, true)
|
126
|
+
|
127
|
+
marshal, compress, value = entity.decompose(marked)
|
128
|
+
|
129
|
+
expect(marshal).to eq(JSON)
|
130
|
+
expect(compress).to eq(true)
|
131
|
+
expect(value).to eq(string)
|
132
|
+
end
|
133
|
+
|
134
|
+
it 'returns the original string without a marker' do
|
135
|
+
string = 'the quick brown fox'
|
136
|
+
entity = Readthis::Entity.new
|
137
|
+
marshal, compress, value = entity.decompose(string)
|
138
|
+
|
139
|
+
expect(marshal).to eq(Marshal)
|
140
|
+
expect(compress).to eq(false)
|
141
|
+
expect(value).to eq(string)
|
142
|
+
end
|
143
|
+
end
|
87
144
|
end
|
@@ -19,7 +19,7 @@ RSpec.describe Readthis::Expanders do
|
|
19
19
|
it 'expands an array of objects' do
|
20
20
|
object = double(cache_key: 'gamma')
|
21
21
|
|
22
|
-
expect(expand([
|
22
|
+
expect(expand(%w[alpha beta])).to eq('alpha/beta')
|
23
23
|
expect(expand([object, object])).to eq('gamma/gamma')
|
24
24
|
end
|
25
25
|
|
@@ -0,0 +1,87 @@
|
|
1
|
+
require 'readthis/serializers'
|
2
|
+
|
3
|
+
RSpec.describe Readthis::Serializers do
|
4
|
+
CustomSerializer = Class.new
|
5
|
+
AnotherSerializer = Class.new
|
6
|
+
|
7
|
+
describe '#<<' do
|
8
|
+
it 'appends new serializers' do
|
9
|
+
serializers = Readthis::Serializers.new
|
10
|
+
|
11
|
+
serializers << CustomSerializer
|
12
|
+
|
13
|
+
expect(serializers.marshals).to include(CustomSerializer)
|
14
|
+
expect(serializers.flags).to eq([1, 2, 3, 4])
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'increments flags' do
|
18
|
+
serializers = Readthis::Serializers.new
|
19
|
+
serializers << CustomSerializer
|
20
|
+
serializers << AnotherSerializer
|
21
|
+
|
22
|
+
expect(serializers.flags).to eq((1..5).to_a)
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'prevents more than seven serializers' do
|
26
|
+
serializers = Readthis::Serializers.new
|
27
|
+
|
28
|
+
expect do
|
29
|
+
10.times { serializers << Class.new }
|
30
|
+
end.to raise_error(Readthis::SerializersLimitError)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe '#assoc' do
|
35
|
+
it 'looks up serializers by module' do
|
36
|
+
serializers = Readthis::Serializers.new
|
37
|
+
|
38
|
+
expect(serializers.assoc(Marshal)).to eq(0x1)
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'raises a helpful error when the serializer is unknown' do
|
42
|
+
serializers = Readthis::Serializers.new
|
43
|
+
|
44
|
+
expect do
|
45
|
+
serializers.assoc(CustomSerializer)
|
46
|
+
end.to raise_error(Readthis::UnknownSerializerError)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe '#rassoc' do
|
51
|
+
it 'inverts the current set of serializers' do
|
52
|
+
serializers = Readthis::Serializers.new
|
53
|
+
|
54
|
+
expect(serializers.rassoc(1)).to eq(Marshal)
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'returns custom serializers' do
|
58
|
+
serializers = Readthis::Serializers.new
|
59
|
+
serializers << CustomSerializer
|
60
|
+
|
61
|
+
expect(serializers.rassoc(4)).to eq(CustomSerializer)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
describe '#freeze!' do
|
66
|
+
it 'does now allow appending after freeze' do
|
67
|
+
serializers = Readthis::Serializers.new
|
68
|
+
|
69
|
+
serializers.freeze!
|
70
|
+
|
71
|
+
expect do
|
72
|
+
serializers << CustomSerializer
|
73
|
+
end.to raise_error(Readthis::SerializersFrozenError)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
describe '#reset!' do
|
78
|
+
it 'reverts back to the original set of serializers' do
|
79
|
+
serializers = Readthis::Serializers.new
|
80
|
+
|
81
|
+
serializers << Class.new
|
82
|
+
serializers.reset!
|
83
|
+
|
84
|
+
expect(serializers.serializers.length).to eq(3)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -16,9 +16,7 @@ RSpec.configure do |config|
|
|
16
16
|
|
17
17
|
config.disable_monkey_patching!
|
18
18
|
|
19
|
-
if config.files_to_run.one?
|
20
|
-
config.default_formatter = 'doc'
|
21
|
-
end
|
19
|
+
config.default_formatter = 'doc' if config.files_to_run.one?
|
22
20
|
|
23
21
|
config.order = :random
|
24
22
|
Kernel.srand config.seed
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: readthis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Parker Selbert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: activesupport
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '4.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '4.0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,44 +108,28 @@ dependencies:
|
|
94
108
|
- - "~>"
|
95
109
|
- !ruby/object:Gem::Version
|
96
110
|
version: '3.1'
|
97
|
-
description:
|
111
|
+
description:
|
98
112
|
email:
|
99
113
|
- parker@sorentwo.com
|
100
114
|
executables: []
|
101
115
|
extensions: []
|
102
116
|
extra_rdoc_files: []
|
103
117
|
files:
|
104
|
-
- ".gitignore"
|
105
|
-
- ".rspec"
|
106
|
-
- ".travis.yml"
|
107
|
-
- CHANGELOG.md
|
108
|
-
- CONTRIBUTING.md
|
109
|
-
- Gemfile
|
110
|
-
- LICENSE.txt
|
111
|
-
- PERFORMANCE.md
|
112
118
|
- README.md
|
113
|
-
- Rakefile
|
114
|
-
- benchmarks/compressed.rb
|
115
|
-
- benchmarks/driver.rb
|
116
|
-
- benchmarks/marshalling.rb
|
117
|
-
- benchmarks/memory.rb
|
118
|
-
- benchmarks/multi.rb
|
119
|
-
- benchmarks/profile.rb
|
120
|
-
- bin/rspec
|
121
119
|
- lib/active_support/cache/readthis_store.rb
|
122
120
|
- lib/readthis.rb
|
123
121
|
- lib/readthis/cache.rb
|
124
122
|
- lib/readthis/entity.rb
|
125
123
|
- lib/readthis/expanders.rb
|
126
|
-
- lib/readthis/notifications.rb
|
127
124
|
- lib/readthis/passthrough.rb
|
125
|
+
- lib/readthis/serializers.rb
|
128
126
|
- lib/readthis/version.rb
|
129
|
-
- readthis.gemspec
|
130
127
|
- spec/readthis/cache_spec.rb
|
131
128
|
- spec/readthis/entity_spec.rb
|
132
129
|
- spec/readthis/expanders_spec.rb
|
133
|
-
- spec/readthis/notifications_spec.rb
|
134
130
|
- spec/readthis/passthrough_spec.rb
|
131
|
+
- spec/readthis/serializers_spec.rb
|
132
|
+
- spec/readthis_spec.rb
|
135
133
|
- spec/spec_helper.rb
|
136
134
|
homepage: https://github.com/sorentwo/readthis
|
137
135
|
licenses:
|
@@ -153,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
151
|
version: '0'
|
154
152
|
requirements: []
|
155
153
|
rubyforge_project:
|
156
|
-
rubygems_version: 2.4.5
|
154
|
+
rubygems_version: 2.4.5.1
|
157
155
|
signing_key:
|
158
156
|
specification_version: 4
|
159
157
|
summary: Pooled active support compliant caching with redis
|
@@ -161,6 +159,7 @@ test_files:
|
|
161
159
|
- spec/readthis/cache_spec.rb
|
162
160
|
- spec/readthis/entity_spec.rb
|
163
161
|
- spec/readthis/expanders_spec.rb
|
164
|
-
- spec/readthis/notifications_spec.rb
|
165
162
|
- spec/readthis/passthrough_spec.rb
|
163
|
+
- spec/readthis/serializers_spec.rb
|
164
|
+
- spec/readthis_spec.rb
|
166
165
|
- spec/spec_helper.rb
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
data/CHANGELOG.md
DELETED
@@ -1,114 +0,0 @@
|
|
1
|
-
## v0.8.1 2015-09-04
|
2
|
-
|
3
|
-
- Changed: `Readthis::Cache` now has an accessor for the options that were
|
4
|
-
passed during initialization. This is primarily to support the session store
|
5
|
-
middleware provided by `ActionDispatch`. See [readthis#16][issue-16].
|
6
|
-
- Fixed: Caching `nil` values is now possible. Previously the value would be
|
7
|
-
converted into a blank string, causing a Marshal error when loading the data.
|
8
|
-
There is still some non-standard handling of `nil` within `fetch` or
|
9
|
-
`fetch_multi`, where a cached `nil` value will always result in a cache miss.
|
10
|
-
See [readthis#15][issue-15].
|
11
|
-
- Fixed: Entity compression was broken, it wouldn't unload data when the
|
12
|
-
compressed size was below the compression limit. Data is now decompressed
|
13
|
-
when it can the value looks to be compressed, falling back to the initial
|
14
|
-
value when decompression fails. See [readthis#13][issue-13] for details.
|
15
|
-
|
16
|
-
[issue-13]: https://github.com/sorentwo/readthis/pull/13
|
17
|
-
[issue-15]: https://github.com/sorentwo/readthis/pull/15
|
18
|
-
[issue-16]: https://github.com/sorentwo/readthis/pull/16
|
19
|
-
|
20
|
-
## v0.8.0 2015-08-26
|
21
|
-
|
22
|
-
- Breaking: The initializer now takes a single options argument instead of a
|
23
|
-
`url` and `options` separately. This allows the underlying redis client to
|
24
|
-
accept any options, rather than just the driver. For example, it's now
|
25
|
-
possible to use Readthis with sentinel directly through the configuration.
|
26
|
-
- Changed: The `hiredis` driver is *no longer the default*. In order to use the
|
27
|
-
vastly faster `hiredis` driver you need to pass it in during construction.
|
28
|
-
See [readthis#9][issue-9] for more discussion.
|
29
|
-
|
30
|
-
[issue-9]: https://github.com/sorentwo/readthis/issues/9
|
31
|
-
|
32
|
-
## v0.7.0 2015-08-11
|
33
|
-
|
34
|
-
- Changed: Entity initialization uses an options hash rather than keyword
|
35
|
-
arguments. This allows flexibility with older Ruby versions (1.9) that aren't
|
36
|
-
officially supported.
|
37
|
-
- Changed: There is no longer a hard dependency on `hiredis`, though it is the
|
38
|
-
default. The redis driver can be configured by passing a `driver: :ruby`
|
39
|
-
option through to the constructor.
|
40
|
-
|
41
|
-
## v0.6.2 2015-04-28
|
42
|
-
|
43
|
-
- Fixed: Set expiration during `write_multi`, primarily effecting `fetch_multi`.
|
44
|
-
This fixes the real issue underlying the change in `v0.6.1`.
|
45
|
-
|
46
|
-
## v0.6.1 2015-04-28
|
47
|
-
|
48
|
-
- Changed: Expiration values are always cast to an integer before use in write
|
49
|
-
operations. This prevents subtle ActiveSupport bugs where the value would be
|
50
|
-
ignored by `setex`.
|
51
|
-
|
52
|
-
## v0.6.0 2015-03-09
|
53
|
-
|
54
|
-
- Fixed: Safely handle calling `read_multi` without any keys. [Michael Rykov]
|
55
|
-
- Fixed: Pointed `redis-activesupport` at master. Only effected development and
|
56
|
-
testing.
|
57
|
-
- Added: A `write_multi` method is no available to bulk set keys and values. It
|
58
|
-
is used by `fetch_multi` internally to ensure that there are at most two Redis
|
59
|
-
calls.
|
60
|
-
|
61
|
-
## v0.5.2 2015-01-09
|
62
|
-
|
63
|
-
- Fixed: Remove the `pipeline` around `fetch_multi` writing. This will slow down
|
64
|
-
`fetch_multi` in cache miss situations for now. It prevents a difficult to
|
65
|
-
track down exception in multi-threaded situations.
|
66
|
-
|
67
|
-
## v0.5.1 2014-12-30
|
68
|
-
|
69
|
-
- Fixed: The `clear` method now accepts an argument for compatibility with other
|
70
|
-
caches. The argument is not actually used for anything.
|
71
|
-
- Changed: The `delete` method will always return a boolean value rather than an
|
72
|
-
integer.
|
73
|
-
- Changed: Avoid multiple instrumentation calls and pool checkouts within
|
74
|
-
`fetch_multi` calls.
|
75
|
-
|
76
|
-
## v0.5.0 2014-12-12
|
77
|
-
|
78
|
-
- Added: All read and write operations are marshalled to and from storage. This
|
79
|
-
allows hashes, arrays, etc. to be restored instead of always returning a
|
80
|
-
string. Unlike `ActiveSupport::Store::Entity`, no new objects are allocated
|
81
|
-
for each entity, reducing GC and improving performance.
|
82
|
-
- Fixed: Increment/Decrement interface was only accepting two params instead of
|
83
|
-
three. Now accepts `amount` as the second parameter.
|
84
|
-
- Changed: Increment/Decrement no longer use `incby` and `decby`, as they don't
|
85
|
-
work with marshalled values. This means they are not entirely atomic, so race
|
86
|
-
conditions are possible.
|
87
|
-
|
88
|
-
## v0.4.0 2014-12-11
|
89
|
-
|
90
|
-
- Added: Force the use of `hiredis` as the adapter. It is dramatically faster,
|
91
|
-
but prevents the project from being used in `jruby`. If we get interest from
|
92
|
-
some `jruby` projects we can soften the requirement.
|
93
|
-
- Added: Compression! Adheres to the `ActiveSupport::Store` documentation.
|
94
|
-
- Fixed: Gracefully handle `nil` passed as `options` to any cache method.
|
95
|
-
|
96
|
-
## v0.3.0 2014-12-01
|
97
|
-
|
98
|
-
- Added: Use `to_param` for key expansion, only when available. Makes it
|
99
|
-
possible to extract a key from any object when ActiveSupport is loaded.
|
100
|
-
- Added: Expand hashes as cache keys.
|
101
|
-
- Changed: Use `mget` for `read_multi`, faster and more synchronous than relying on
|
102
|
-
`pipelined`.
|
103
|
-
- Changed: Delimit compound objects with a slash rather than a colon.
|
104
|
-
|
105
|
-
## v0.2.0 2014-11-24
|
106
|
-
|
107
|
-
- Added: Instrument all caching methods. Will use `ActiveSupport::Notifications`
|
108
|
-
if available, otherwise falls back to a polyfill.
|
109
|
-
- Added: Expand objects with a `cache_key` method and arrays of strings or objects into
|
110
|
-
consistent naespaced keys.
|
111
|
-
|
112
|
-
## v0.1.0 2014-11-22
|
113
|
-
|
114
|
-
- Initial release! Working as a drop in replacement for `redis_store`.
|
data/CONTRIBUTING.md
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# Contributing
|
2
|
-
|
3
|
-
## Open an Issue
|
4
|
-
|
5
|
-
Let us know about bugs. Include your version of Readthis, Ruby, and the
|
6
|
-
environment you are using.
|
7
|
-
|
8
|
-
## Submit a Pull Request
|
9
|
-
|
10
|
-
1. Fork it ( https://github.com/sorentwo/readthis/fork )
|
11
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
12
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
13
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
14
|
-
5. Create a new Pull Request
|
data/Gemfile
DELETED
data/LICENSE.txt
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2014 Parker Selbert
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/PERFORMANCE.md
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
Results from the various benchmarks in `./bencharks`. Hardware doesn't matter
|
2
|
-
much, as we're simply looking for a comparison against other libraries and prior
|
3
|
-
verions.
|
4
|
-
|
5
|
-
## Footprint
|
6
|
-
|
7
|
-
Footprint compared to `redis-activesupport`:
|
8
|
-
|
9
|
-
```
|
10
|
-
# Total allocated objects after require
|
11
|
-
readthis: 20602
|
12
|
-
redis-activesupport: 78630
|
13
|
-
```
|
14
|
-
|
15
|
-
## Performance
|
16
|
-
|
17
|
-
Performance compared to `dalli` and `redis-activesupport`:
|
18
|
-
|
19
|
-
```
|
20
|
-
Raw Read Multi:
|
21
|
-
Calculating -------------------------------------
|
22
|
-
readthis:read-multi 358.000 i/100ms
|
23
|
-
redisas:read-multi 94.000 i/100ms
|
24
|
-
dalli:read-multi 99.000 i/100ms
|
25
|
-
-------------------------------------------------
|
26
|
-
readthis:read-multi 3.800k (± 2.3%) i/s - 19.332k
|
27
|
-
redisas:read-multi 962.199 (± 3.6%) i/s - 4.888k
|
28
|
-
dalli:read-multi 995.353 (± 1.1%) i/s - 5.049k
|
29
|
-
|
30
|
-
Comparison:
|
31
|
-
readthis:read-multi: 3799.8 i/s
|
32
|
-
dalli:read-multi: 995.4 i/s - 3.82x slower
|
33
|
-
redisas:read-multi: 962.2 i/s - 3.95x slower
|
34
|
-
|
35
|
-
Raw Fetch Multi:
|
36
|
-
Calculating -------------------------------------
|
37
|
-
readthis:fetch-multi 336.000 i/100ms
|
38
|
-
redisas:fetch-multi 86.000 i/100ms
|
39
|
-
dalli:fetch-multi 102.000 i/100ms
|
40
|
-
-------------------------------------------------
|
41
|
-
readthis:fetch-multi 3.424k (± 2.6%) i/s - 17.136k
|
42
|
-
redisas:fetch-multi 874.803 (± 2.7%) i/s - 4.386k
|
43
|
-
dalli:fetch-multi 1.028k (± 1.2%) i/s - 5.202k
|
44
|
-
|
45
|
-
Comparison:
|
46
|
-
readthis:fetch-multi: 3424.2 i/s
|
47
|
-
dalli:fetch-multi: 1027.7 i/s - 3.33x slower
|
48
|
-
redisas:fetch-multi: 874.8 i/s - 3.91x slower
|
49
|
-
|
50
|
-
Compressed Writes:
|
51
|
-
Calculating -------------------------------------
|
52
|
-
readthis:write 924.000 i/100ms
|
53
|
-
dalli:write 903.000 i/100ms
|
54
|
-
-------------------------------------------------
|
55
|
-
readthis:write 10.105k (± 4.9%) i/s - 50.820k
|
56
|
-
dalli:write 9.662k (± 1.6%) i/s - 48.762k
|
57
|
-
|
58
|
-
Comparison:
|
59
|
-
readthis:write: 10105.3 i/s
|
60
|
-
dalli:write: 9662.4 i/s - 1.05x slower
|
61
|
-
|
62
|
-
Compressed Read Multi:
|
63
|
-
Calculating -------------------------------------
|
64
|
-
readthis:read_multi 325.000 i/100ms
|
65
|
-
dalli:read_multi 100.000 i/100ms
|
66
|
-
-------------------------------------------------
|
67
|
-
readthis:read_multi 3.357k (± 2.3%) i/s - 16.900k
|
68
|
-
dalli:read_multi 1.014k (± 3.1%) i/s - 5.100k
|
69
|
-
|
70
|
-
Comparison:
|
71
|
-
readthis:read_multi: 3356.5 i/s
|
72
|
-
dalli:read_multi: 1014.1 i/s - 3.31x slower
|
73
|
-
```
|
data/Rakefile
DELETED