memo_wise 1.7.0 → 1.11.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/CHANGELOG.md +260 -123
- data/README.md +70 -40
- data/lib/memo_wise/internal_api.rb +39 -13
- data/lib/memo_wise/version.rb +1 -1
- data/lib/memo_wise.rb +30 -17
- metadata +4 -23
- data/.dokaz +0 -2
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -4
- data/.github/dependabot.yml +0 -20
- data/.github/workflows/main.yml +0 -57
- data/.gitignore +0 -13
- data/.rspec +0 -3
- data/.rubocop.yml +0 -17
- data/.ruby-version +0 -1
- data/.yardopts +0 -8
- data/CODE_OF_CONDUCT.md +0 -76
- data/Gemfile +0 -36
- data/Gemfile.lock +0 -124
- data/Rakefile +0 -3
- data/benchmarks/Gemfile +0 -21
- data/benchmarks/benchmarks.rb +0 -274
- data/bin/console +0 -8
- data/bin/setup +0 -8
- data/logo/logo.png +0 -0
- data/memo_wise.gemspec +0 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 580c75382ed661927635d86573723585ac070bb1b173684ca58d7c47250cdeeb
|
4
|
+
data.tar.gz: 8fa8aadd0eeb70bedb7e7f149942b1959ce3b807ad24c99e4b5558fe283fc669
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f12681421e4994476929d36d6ee7d16c7a67f4641540a8291b8fa1c939bc9d4877930ace711544ed8f9ec80d2db92ac266c3155e1e0a6fa05e4cea75630c704
|
7
|
+
data.tar.gz: 82094910c30c4bfbb317b285f3a7f6bd7c03c34d427d0788c58c2e7cf329ab03e37862d817b3686edcf4b03d55c084a834964aca5957137f2199927155611fe6
|
data/CHANGELOG.md
CHANGED
@@ -1,156 +1,293 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
All notable changes to this project will be documented in this file
|
3
|
+
All notable changes to this project will be documented in this file, which
|
4
|
+
follows a format inspired by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
4
5
|
|
5
|
-
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
|
+
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
-
## Unreleased
|
8
|
+
## [Unreleased](https://github.com/panorama-ed/memo_wise/compare/v1.11.0...HEAD)
|
9
9
|
|
10
|
-
|
10
|
+
**Gem enhancements:** none
|
11
11
|
|
12
|
-
|
12
|
+
_No breaking changes!_
|
13
13
|
|
14
|
-
|
14
|
+
**Project enhancements:** none
|
15
15
|
|
16
|
-
-
|
17
|
-
([#276](https://github.com/panorama-ed/memo_wise/pull/276))
|
16
|
+
## [v1.11.0](https://github.com/panorama-ed/memo_wise/compare/v1.10.0...v1.11.0)
|
18
17
|
|
19
|
-
|
18
|
+
**Gem enhancements:**
|
20
19
|
|
21
|
-
|
20
|
+
- Stopped `preset_memo_wise` (and `reset_memo_wise` with an argument) from raising errors when called on module methods [[#377]](https://github.com/panorama-ed/memo_wise/pull/377)
|
21
|
+
- Changed internal `require`s to `require_relative` to make code less dependent on the load path [[#350](https://github.com/panorama-ed/memo_wise/pull/350)]
|
22
22
|
|
23
|
-
|
24
|
-
|
23
|
+
_Breaking changes:_
|
24
|
+
- Removed Ruby 2.5 (EOL) and 2.6 (EOL) support to allow upgrading rexml dependency version from a version that includes a [CVE](https://www.ruby-lang.org/en/news/2024/10/28/redos-rexml-cve-2024-49761/) [[#362]](https://github.com/panorama-ed/memo_wise/pull/362)
|
25
25
|
|
26
|
-
|
26
|
+
**Project enhancements:**
|
27
27
|
|
28
|
-
-
|
28
|
+
- Updated `webrick` in `Gemfile.lock` to resolve CVE-2024-47220. This vulnerability does not impact `memo_wise` users.
|
29
|
+
- Allowed more tests to run on JRuby [[#377]](https://github.com/panorama-ed/memo_wise/pull/377)
|
29
30
|
|
30
|
-
## [
|
31
|
+
## [v1.10.0](https://github.com/panorama-ed/memo_wise/compare/v1.9.0...v1.10.0)
|
31
32
|
|
32
|
-
|
33
|
+
**Gem enhancements:**
|
33
34
|
|
34
|
-
-
|
35
|
-
bugs
|
36
|
-
- Switch to a simpler internal data structure to fix several classes of bugs
|
37
|
-
related to inheritance that the previous few versions were unable to
|
38
|
-
sufficiently address
|
35
|
+
- Reduced gem size from 173 kB compressed (312 kB unpacked) to 18.5 kB (68 kB unpacked) [[#345](https://github.com/panorama-ed/memo_wise/pull/345)]
|
39
36
|
|
40
|
-
|
37
|
+
_No breaking changes!_
|
41
38
|
|
42
|
-
|
39
|
+
**Project enhancements:**
|
43
40
|
|
44
|
-
-
|
45
|
-
|
41
|
+
- Updated official test coverage to support Ruby 3.3 [[#335](https://github.com/panorama-ed/memo_wise/pull/335)]
|
42
|
+
- Added `alt_memery` and `memoist3` to benchmarks [[#339](https://github.com/panorama-ed/memo_wise/pull/339)]
|
43
|
+
- Updated benchmark results in `README.md` to Ruby 3.3.5 [[#339](https://github.com/panorama-ed/memo_wise/pull/339)]
|
46
44
|
|
47
|
-
## [
|
45
|
+
## [v1.9.0](https://github.com/panorama-ed/memo_wise/compare/v1.8.0...v1.9.0)
|
48
46
|
|
49
|
-
|
47
|
+
**Gem enhancements:**
|
50
48
|
|
51
|
-
-
|
52
|
-
|
53
|
-
- Fix bugs related to child classes inheriting from parent classes that use
|
54
|
-
`MemoWise`
|
49
|
+
- Fixed a bug that overwrote existing self.extended method definitions. [[#324](https://github.com/panorama-ed/memo_wise/pull/314)]
|
50
|
+
- Fixed a bug that overwrote existing self.inherited method definitions. [[#325](https://github.com/panorama-ed/memo_wise/pull/315)]
|
55
51
|
|
56
|
-
|
52
|
+
_Breaking changes:_
|
53
|
+
- Removed Ruby 2.4 (EOL) support to allow upgrading rexml dependency version from a version that includes a [CVE](https://www.ruby-lang.org/en/news/2024/05/16/dos-rexml-cve-2024-35176/) [[#336](https://github.com/panorama-ed/memo_wise/pull/336)]
|
57
54
|
|
58
|
-
|
59
|
-
- Improved performance of all methods by using an outer Array instead of a Hash
|
60
|
-
- Improved performance for multi-argument methods and simplify internal data
|
61
|
-
structures
|
55
|
+
**Project enhancements:**
|
62
56
|
|
63
|
-
|
64
|
-
-
|
65
|
-
- Updated internal local variable names to avoid name collisions with method
|
66
|
-
arguments
|
57
|
+
- Fixed `bundle exec yard server --reload` and related documentation [[#333](https://github.com/panorama-ed/memo_wise/pull/333)]
|
58
|
+
- Fixed Codecov rate limiting errors affecting pull requests by upgrading `codecov/codecov-action` and using a Codecov token [[#317](https://github.com/panorama-ed/memo_wise/pull/317)]
|
67
59
|
|
68
|
-
|
69
|
-
- None
|
60
|
+
## [v1.8.0](https://github.com/panorama-ed/memo_wise/compare/v1.7.0...v1.8.0) - 2023-10-25
|
70
61
|
|
71
|
-
|
72
|
-
### Updated
|
73
|
-
- Improved performance across the board by:
|
74
|
-
- removing `Hash#fetch`
|
75
|
-
- using `Array#hash`
|
76
|
-
- avoiding multi-layer hash lookups for multi-argument methods
|
77
|
-
- optimizing for truthy results
|
78
|
-
- Add `dry-core` to benchmarks in README
|
62
|
+
**Gem enhancements:**
|
79
63
|
|
80
|
-
|
81
|
-
- Fixed usage on module singleton classes
|
82
|
-
- Fixed usage on module which would be extended by other classes
|
64
|
+
- In Ruby3.2+, for singleton classes, use `#attached_object` instead of `ObjectSpace` [[#318](https://github.com/panorama-ed/memo_wise/pull/318)]
|
83
65
|
|
84
|
-
|
85
|
-
- None
|
66
|
+
_No breaking changes!_
|
86
67
|
|
87
|
-
|
88
|
-
### Added
|
89
|
-
- Support for `.preset_memo_wise` on class methods
|
90
|
-
- Support for `.reset_memo_wise` on class methods
|
68
|
+
**Project enhancements:**
|
91
69
|
|
92
|
-
|
93
|
-
-
|
70
|
+
- Switched RuboCop configuration from `panolint` to `panolint-ruby` [[#312](https://github.com/panorama-ed/memo_wise/pull/312)]
|
71
|
+
- Updated benchmark results in `README.md` to Ruby 3.2.2 and 2.7.8 [[#313](https://github.com/panorama-ed/memo_wise/pull/297)]
|
72
|
+
- Updated `Dry::Core` gem version to 1.0.0 in benchmarks [[#297](https://github.com/panorama-ed/memo_wise/pull/297)]
|
73
|
+
- Updated `Memery` gem version to 1.5.0 in benchmarks [[#313](https://github.com/panorama-ed/memo_wise/pull/313)]
|
74
|
+
- Updated `Memoized` gem version to 1.1.1 in benchmarks [[#288](https://github.com/panorama-ed/memo_wise/pull/288)]
|
75
|
+
- Reorganized `CHANGELOG.md` for improved clarity and completeness [[#282](https://github.com/panorama-ed/memo_wise/pull/282)]
|
94
76
|
|
95
|
-
## [0.
|
96
|
-
### Added
|
97
|
-
- Documentation of confusing module test behavior
|
98
|
-
- Support using MemoWise in classes with keyword arguments in the initializer
|
99
|
-
- Support Marshal dump/load of classes using MemoWise
|
77
|
+
## [v1.7.0](https://github.com/panorama-ed/memo_wise/compare/v1.6.0...v1.7.0) - 2022-04-04
|
100
78
|
|
101
|
-
|
102
|
-
|
103
|
-
-
|
104
|
-
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
-
|
124
|
-
|
125
|
-
## [0.
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
-
|
140
|
-
|
141
|
-
[
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
[
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
[
|
153
|
-
|
154
|
-
[
|
155
|
-
|
156
|
-
|
79
|
+
**Gem enhancements:**
|
80
|
+
|
81
|
+
- Optimized memoized lookups for methods with multiple required arguments
|
82
|
+
[[#276](https://github.com/panorama-ed/memo_wise/pull/276)]
|
83
|
+
|
84
|
+
_No breaking changes!_
|
85
|
+
|
86
|
+
**Project enhancements:**
|
87
|
+
|
88
|
+
- Added benchmarking against GitHub `main` branch to CI [[#274](https://github.com/panorama-ed/memo_wise/pull/274)]
|
89
|
+
|
90
|
+
## [v1.6.0](https://github.com/panorama-ed/memo_wise/compare/v1.5.0...v1.6.0) - 2022-01-24
|
91
|
+
|
92
|
+
**Gem enhancements:**
|
93
|
+
|
94
|
+
- Fixed a bug relating to inheritance of classes which include a module which
|
95
|
+
`prepend`s `MemoWise` [[#262](https://github.com/panorama-ed/memo_wise/pull/262)]
|
96
|
+
|
97
|
+
_No breaking changes!_
|
98
|
+
|
99
|
+
**Project enhancements:**
|
100
|
+
|
101
|
+
- Updated official test coverage to support Ruby 3.1 [[#263](https://github.com/panorama-ed/memo_wise/pull/263)]
|
102
|
+
|
103
|
+
## [v1.5.0](https://github.com/panorama-ed/memo_wise/compare/v1.4.0...v1.5.0) - 2021-12-17
|
104
|
+
|
105
|
+
**Gem enhancements:**
|
106
|
+
|
107
|
+
- Removed thread-unsafe optimization which optimized for returning "truthy" results
|
108
|
+
[[#255](https://github.com/panorama-ed/memo_wise/pull/255)]
|
109
|
+
- Switched to a simpler internal data structure to fix several classes of bugs related to inheritance
|
110
|
+
that the previous few versions were unable to sufficiently address
|
111
|
+
[[#250](https://github.com/panorama-ed/memo_wise/pull/250)]
|
112
|
+
|
113
|
+
_No breaking changes!_
|
114
|
+
|
115
|
+
**Project enhancements:**
|
116
|
+
|
117
|
+
- Expanded thread-safety testing [[#254](https://github.com/panorama-ed/memo_wise/pull/254)]
|
118
|
+
|
119
|
+
## [v1.4.0](https://github.com/panorama-ed/memo_wise/compare/v1.3.0...v1.4.0) - 2021-12-10
|
120
|
+
|
121
|
+
**Gem enhancements:**
|
122
|
+
|
123
|
+
- Fixed several bugs related to classes inheriting memoized methods from multiple modules or a parent class
|
124
|
+
[[#241](https://github.com/panorama-ed/memo_wise/pull/241)]
|
125
|
+
|
126
|
+
_No breaking changes!_
|
127
|
+
|
128
|
+
**Project enhancements:**
|
129
|
+
|
130
|
+
- Added TruffleRuby tests to CI [[#237](https://github.com/panorama-ed/memo_wise/pull/237)]
|
131
|
+
|
132
|
+
## [v1.3.0](https://github.com/panorama-ed/memo_wise/compare/v1.2.0...v1.3.0) - 2021-11-22
|
133
|
+
|
134
|
+
**Gem enhancements:**
|
135
|
+
|
136
|
+
- Fixed thread-safety issue in concurrent calls to a zero-arg method in an unmemoized state (which resulted in a `nil` value being incorrectly returned in one thread) [[#230](https://github.com/panorama-ed/memo_wise/pull/230)]
|
137
|
+
- Fixed bugs related to child classes inheriting from parent classes that use `MemoWise`
|
138
|
+
[[#229](https://github.com/panorama-ed/memo_wise/pull/229)]
|
139
|
+
|
140
|
+
_No breaking changes!_
|
141
|
+
|
142
|
+
**Project enhancements:**
|
143
|
+
|
144
|
+
- Added thread-safety test [[#225](https://github.com/panorama-ed/memo_wise/pull/225)]
|
145
|
+
|
146
|
+
## [v1.2.0](https://github.com/panorama-ed/memo_wise/compare/v1.1.0...v1.2.0) - 2021-11-10
|
147
|
+
|
148
|
+
**Gem enhancements:**
|
149
|
+
|
150
|
+
- Optimized memoized lookups for all methods by using an outer array instead of a hash
|
151
|
+
[[#211](https://github.com/panorama-ed/memo_wise/pull/211),
|
152
|
+
[#210](https://github.com/panorama-ed/memo_wise/pull/210),
|
153
|
+
[#219](https://github.com/panorama-ed/memo_wise/pull/219)]
|
154
|
+
- Removed an internal optimization using `#hash` due to the potential of hash collisions
|
155
|
+
[[#219](https://github.com/panorama-ed/memo_wise/pull/219)]
|
156
|
+
- Changed internal local variable names to avoid name collisions with memoized method arguments
|
157
|
+
[[#221](https://github.com/panorama-ed/memo_wise/pull/221)]
|
158
|
+
|
159
|
+
_No breaking changes!_
|
160
|
+
|
161
|
+
**Project enhancements:**
|
162
|
+
|
163
|
+
- Added nuance to benchmarks [[#214](https://github.com/panorama-ed/memo_wise/pull/214)]
|
164
|
+
- Significantly sped up tests [[#206](https://github.com/panorama-ed/memo_wise/pull/206)]
|
165
|
+
|
166
|
+
## [v1.1.0](https://github.com/panorama-ed/memo_wise/compare/v1.0.0...v1.1.0) - 2021-07-29
|
167
|
+
|
168
|
+
**Gem enhancements:**
|
169
|
+
|
170
|
+
- Fixed buggy behavior in module singleton classes and modules extended by other classes
|
171
|
+
[[#185](https://github.com/panorama-ed/memo_wise/pull/185)]
|
172
|
+
- Optimized memoized lookups in many cases, using a variety of optimizations
|
173
|
+
[[#189](https://github.com/panorama-ed/memo_wise/pull/189)]
|
174
|
+
|
175
|
+
_No breaking changes!_
|
176
|
+
|
177
|
+
**Project enhancements:**
|
178
|
+
|
179
|
+
- Added the `dry-core` gem to benchmarks [[#187](https://github.com/panorama-ed/memo_wise/pull/187)]
|
180
|
+
|
181
|
+
## [v1.0.0](https://github.com/panorama-ed/memo_wise/compare/v0.4.0...v1.0.0) - 2021-06-24
|
182
|
+
|
183
|
+
**Gem enhancements:**
|
184
|
+
|
185
|
+
- Class methods are now supported by `#preset_memo_wise` and `#reset_memo_wise`
|
186
|
+
[[#134](https://github.com/panorama-ed/memo_wise/pull/134),
|
187
|
+
[#145](https://github.com/panorama-ed/memo_wise/pull/145)]
|
188
|
+
- Optimized memoized lookups in many cases [[#143](https://github.com/panorama-ed/memo_wise/pull/143)]
|
189
|
+
- Implemented `.instance_method` to proxy original method parameters
|
190
|
+
[[#163](https://github.com/panorama-ed/memo_wise/pull/163)]
|
191
|
+
|
192
|
+
_No breaking changes!_
|
193
|
+
|
194
|
+
**Project enhancements:** none
|
195
|
+
|
196
|
+
## [v0.4.0](https://github.com/panorama-ed/memo_wise/compare/v0.3.0...v0.4.0) - 2021-04-30
|
197
|
+
|
198
|
+
**Gem enhancements:**
|
199
|
+
|
200
|
+
- Methods on objects that are serialized/deserialized with `Marshal` can now be memoized
|
201
|
+
[[#138](https://github.com/panorama-ed/memo_wise/pull/138)]
|
202
|
+
- Classes with keyword arguments in `#initialize` can now support memoization
|
203
|
+
[[#125](https://github.com/panorama-ed/memo_wise/pull/125)]
|
204
|
+
|
205
|
+
_No breaking changes!_
|
206
|
+
|
207
|
+
**Project enhancements:**
|
208
|
+
|
209
|
+
- Added [`A Note on Testing`](https://github.com/panorama-ed/memo_wise#a-note-on-testing) section of `README.md`
|
210
|
+
[[#123](https://github.com/panorama-ed/memo_wise/pull/123)]
|
211
|
+
|
212
|
+
## [v0.3.0](https://github.com/panorama-ed/memo_wise/compare/v0.2.0...v0.3.0) - 2021-02-11
|
213
|
+
|
214
|
+
**Gem enhancements:**
|
215
|
+
|
216
|
+
- Class methods can now be memoized [[#83](https://github.com/panorama-ed/memo_wise/pull/83)]
|
217
|
+
- Instance methods on objects created with `Class#allocate` can now be memoized
|
218
|
+
[[#99](https://github.com/panorama-ed/memo_wise/pull/99)]
|
219
|
+
- Fixed `#reset_memo_wise` for private methods [[#111](https://github.com/panorama-ed/memo_wise/pull/111)]
|
220
|
+
|
221
|
+
_No breaking changes!_
|
222
|
+
|
223
|
+
**Project enhancements:**
|
224
|
+
|
225
|
+
- Added the project logo [[#81](https://github.com/panorama-ed/memo_wise/pull/81)]
|
226
|
+
- Added `CHANGELOG.md` and version tags [[#78](https://github.com/panorama-ed/memo_wise/pull/78)]
|
227
|
+
- Documented release procedure in `README.md` [[#114](https://github.com/panorama-ed/memo_wise/pull/114)]
|
228
|
+
- Updated CI testing and benchmarks for Ruby 3.0 [[#101](https://github.com/panorama-ed/memo_wise/pull/101)]
|
229
|
+
|
230
|
+
## [v0.2.0](https://github.com/panorama-ed/memo_wise/compare/v0.1.2...v0.2.0) - 2020-10-28
|
231
|
+
|
232
|
+
**Gem enhancements:**
|
233
|
+
|
234
|
+
- Added `#preset_memo_wise` to preset memoization values [[#30](https://github.com/panorama-ed/memo_wise/pull/30)]
|
235
|
+
|
236
|
+
_Breaking changes:_
|
237
|
+
|
238
|
+
- Removed `#reset_all_memo_wise` (use `#reset_memo_wise` instead)
|
239
|
+
[[#52](https://github.com/panorama-ed/memo_wise/pull/52)]
|
240
|
+
|
241
|
+
**Project enhancements:**
|
242
|
+
|
243
|
+
- YARD docs are now generated [[#52](https://github.com/panorama-ed/memo_wise/pull/52),
|
244
|
+
[#55](https://github.com/panorama-ed/memo_wise/pull/55),
|
245
|
+
[#57](https://github.com/panorama-ed/memo_wise/pull/57)]
|
246
|
+
- 100% code coverage is now enforced [[#62](https://github.com/panorama-ed/memo_wise/pull/62)]
|
247
|
+
|
248
|
+
## [v0.1.2](https://github.com/panorama-ed/memo_wise/compare/v0.1.1...v0.1.2) - 2020-10-01
|
249
|
+
|
250
|
+
**Gem enhancements:**
|
251
|
+
|
252
|
+
- Optimized memoized lookups with internal data structure and method signature changes
|
253
|
+
[[#28](https://github.com/panorama-ed/memo_wise/pull/28), [#32](https://github.com/panorama-ed/memo_wise/pull/32)]
|
254
|
+
|
255
|
+
_No breaking changes!_
|
256
|
+
|
257
|
+
**Project enhancements:**
|
258
|
+
|
259
|
+
- Tests now assert that memoization works with the `Values` gem
|
260
|
+
[[#46](https://github.com/panorama-ed/memo_wise/pull/46)]
|
261
|
+
- Added `README.md` badges for tests, docs, and RubyGems
|
262
|
+
[[#47](https://github.com/panorama-ed/memo_wise/pull/47)]
|
263
|
+
|
264
|
+
## [v0.1.1](https://github.com/panorama-ed/memo_wise/compare/v0.1.0...v0.1.1) - 2020-08-03
|
265
|
+
|
266
|
+
**Gem enhancements:**
|
267
|
+
|
268
|
+
- `#reset_memo_wise` can now reset memoization for specific method arguments
|
269
|
+
[[#20](https://github.com/panorama-ed/memo_wise/pull/20)]
|
270
|
+
|
271
|
+
_No breaking changes!_
|
272
|
+
|
273
|
+
**Project enhancements:**
|
274
|
+
|
275
|
+
- Added benchmarks to compare `MemoWise` to other Ruby memoization gems
|
276
|
+
[[#13](https://github.com/panorama-ed/memo_wise/pull/13)]
|
277
|
+
|
278
|
+
## [v0.1.0](https://github.com/panorama-ed/memo_wise/compare/v0.0.1...v0.1.0) - 2020-07-20
|
279
|
+
|
280
|
+
**Gem enhancements:**
|
281
|
+
|
282
|
+
- Added `#memo_wise`, which enables method memoization [[#4](https://github.com/panorama-ed/memo_wise/pull/4)]
|
283
|
+
- Added `#reset_memo_wise` and `#reset_all_memo_wise`, which reset memoization
|
284
|
+
[[#4](https://github.com/panorama-ed/memo_wise/pull/4)]
|
285
|
+
|
286
|
+
_No breaking changes!_
|
287
|
+
|
288
|
+
**Project enhancements:** none
|
289
|
+
|
290
|
+
## [v0.0.1](https://github.com/panorama-ed/memo_wise/releases/tag/v0.0.1) - 2020-06-29
|
291
|
+
|
292
|
+
*This version does not provide memoization functionality; it simply includes
|
293
|
+
project scaffolding.*
|
data/README.md
CHANGED
@@ -6,8 +6,8 @@
|
|
6
6
|
# `MemoWise`
|
7
7
|
|
8
8
|
[](https://github.com/panorama-ed/memo_wise/actions?query=workflow%3AMain)
|
9
|
-
[](https://codecov.io/gh/panorama-ed/memo_wise
|
10
|
-
[](http://rubydoc.info/
|
9
|
+
[](https://codecov.io/gh/panorama-ed/memo_wise)
|
10
|
+
[](http://rubydoc.info/gems/memo_wise)
|
11
11
|
[](https://rubygems.org/gems/memo_wise)
|
12
12
|
[](https://rubygems.org/gems/memo_wise)
|
13
13
|
|
@@ -112,38 +112,38 @@ For more usage details, see our detailed [documentation](#documentation).
|
|
112
112
|
|
113
113
|
## Benchmarks
|
114
114
|
|
115
|
-
Benchmarks are run in GitHub Actions, and the tables below are updated with every code change. **Values >1.00x represent how much _slower_ each gem’s memoized value retrieval is than the latest commit of `MemoWise`**, according to [`benchmark-ips`](https://github.com/evanphx/benchmark-ips) (2.
|
115
|
+
Benchmarks are run in GitHub Actions, and the tables below are updated with every code change. **Values >1.00x represent how much _slower_ each gem’s memoized value retrieval is than the latest commit of `MemoWise`**, according to [`benchmark-ips`](https://github.com/evanphx/benchmark-ips) (2.14.0).
|
116
116
|
|
117
|
-
Results using Ruby 3.
|
117
|
+
Results using Ruby 3.3.6:
|
118
118
|
|
119
|
-
|Method arguments|`
|
120
|
-
|
121
|
-
|`()` (none)|
|
122
|
-
|`(a)`|
|
123
|
-
|`(a, b)`|
|
124
|
-
|`(a:)`|1.
|
125
|
-
|`(a:, b:)`|
|
126
|
-
|`(a, b:)`|
|
127
|
-
|`(a, *args)`|0.
|
128
|
-
|`(a:, **kwargs)`|0.
|
129
|
-
|`(a, *args, b:, **kwargs)`|0.
|
130
|
-
|
131
|
-
\* `
|
119
|
+
|Method arguments|`alt_memery` (2.1.0)|`dry-core`\* (1.0.2)|`memery` (1.6.0)|`memoist3` (1.0.0)|
|
120
|
+
|--|--|--|--|--|
|
121
|
+
|`()` (none)|12.97x|0.63x|3.31x|2.62x|
|
122
|
+
|`(a)`|9.62x|0.99x|3.86x|14.61x|
|
123
|
+
|`(a, b)`|7.82x|0.85x|3.12x|11.75x|
|
124
|
+
|`(a:)`|15.36x|1.01x|6.72x|19.70x|
|
125
|
+
|`(a:, b:)`|13.07x|0.90x|5.61x|20.64x|
|
126
|
+
|`(a, b:)`|12.68x|0.89x|5.63x|16.27x|
|
127
|
+
|`(a, *args)`|1.93x|0.74x|0.78x|2.85x|
|
128
|
+
|`(a:, **kwargs)`|2.81x|0.72x|1.19x|4.48x|
|
129
|
+
|`(a, *args, b:, **kwargs)`|1.75x|0.66x|0.87x|2.82x|
|
130
|
+
|
131
|
+
\* `dry-core`
|
132
132
|
[may cause incorrect behavior caused by hash collisions](https://github.com/dry-rb/dry-core/issues/63).
|
133
133
|
|
134
|
-
Results using Ruby 2.7.
|
134
|
+
Results using Ruby 2.7.8 (because these gems raise errors in Ruby 3.x):
|
135
135
|
|
136
|
-
|Method arguments|`
|
136
|
+
|Method arguments|`ddmemoize` (1.0.0)|`memoist` (0.16.2)|`memoized` (1.1.1)|`memoizer` (1.0.3)|
|
137
137
|
|--|--|--|--|--|
|
138
|
-
|`()` (none)|24.
|
139
|
-
|`(a)`|
|
140
|
-
|`(a, b)`|
|
141
|
-
|`(a:)`|
|
142
|
-
|`(a:, b:)`|
|
143
|
-
|`(a, b:)`|
|
144
|
-
|`(a, *args)`|3.
|
145
|
-
|`(a:, **kwargs)`|2.
|
146
|
-
|`(a, *args, b:, **kwargs)`|2.
|
138
|
+
|`()` (none)|24.14x|2.44x|23.84x|2.59x|
|
139
|
+
|`(a)`|22.16x|14.80x|20.70x|11.67x|
|
140
|
+
|`(a, b)`|19.39x|13.66x|18.03x|11.46x|
|
141
|
+
|`(a:)`|30.54x|23.68x|25.21x|21.20x|
|
142
|
+
|`(a:, b:)`|27.75x|22.59x|23.47x|20.65x|
|
143
|
+
|`(a, b:)`|26.72x|21.39x|21.73x|19.43x|
|
144
|
+
|`(a, *args)`|3.26x|2.31x|3.09x|1.93x|
|
145
|
+
|`(a:, **kwargs)`|2.87x|2.29x|2.51x|2.10x|
|
146
|
+
|`(a, *args, b:, **kwargs)`|2.23x|1.88x|1.97x|1.73x|
|
147
147
|
|
148
148
|
You can run benchmarks yourself with:
|
149
149
|
|
@@ -176,18 +176,42 @@ versions:
|
|
176
176
|
|
177
177
|
## Documentation
|
178
178
|
|
179
|
-
###
|
179
|
+
### Automatically Generated Docs
|
180
180
|
|
181
181
|
We maintain API documentation using [YARD](https://yardoc.org/), which is
|
182
182
|
published automatically at
|
183
|
-
[RubyDoc.info](https://rubydoc.info/
|
184
|
-
|
183
|
+
[RubyDoc.info](https://rubydoc.info/gems/memo_wise).
|
184
|
+
|
185
|
+
To generate documentation locally or run documentation tests,
|
186
|
+
first install the `docs` dependencies (e.g. `yard`) as follows:
|
185
187
|
|
186
188
|
```bash
|
187
|
-
bundle
|
189
|
+
BUNDLE_WITH=docs bundle install
|
188
190
|
```
|
189
191
|
|
190
|
-
###
|
192
|
+
### Hot Reloading Docs Locally
|
193
|
+
|
194
|
+
To edit documentation locally and see it rendered in your browser
|
195
|
+
using hot reloading, run:
|
196
|
+
|
197
|
+
```bash
|
198
|
+
BUNDLE_WITH=docs bundle exec yard server --reload
|
199
|
+
```
|
200
|
+
|
201
|
+
You can then open your web browser to `http://127.0.0.1:8808/`. As you
|
202
|
+
edit documentation locally, reload your browser to see it generated.
|
203
|
+
|
204
|
+
### Static Generate Docs Locally
|
205
|
+
|
206
|
+
To statically generate documentation locally, run:
|
207
|
+
|
208
|
+
```bash
|
209
|
+
bundle exec yard
|
210
|
+
```
|
211
|
+
|
212
|
+
You can then open the generated documentation at `docs/index.html`.
|
213
|
+
|
214
|
+
### Test all Docs Examples
|
191
215
|
|
192
216
|
We use [yard-doctest](https://github.com/p0deje/yard-doctest) to test all
|
193
217
|
code examples in our YARD documentation. To run `doctest` locally:
|
@@ -204,7 +228,7 @@ locally:
|
|
204
228
|
bundle exec dokaz
|
205
229
|
```
|
206
230
|
|
207
|
-
|
231
|
+
## A Note on Testing
|
208
232
|
|
209
233
|
When testing memoized *module* methods, note that some testing setups will
|
210
234
|
reuse the same instance (which `include`s/`extend`s/`prepend`s the module)
|
@@ -235,7 +259,7 @@ And we've written more about `MemoWise` in a series of blog posts:
|
|
235
259
|
|
236
260
|
- [Introducing: MemoWise](https://medium.com/building-panorama-education/introducing-memowise-51a5f0523489)
|
237
261
|
- [Optimizing MemoWise Performance](https://ja.cob.land/optimizing-memowise-performance)
|
238
|
-
- [
|
262
|
+
- [Esoteric Ruby in MemoWise](https://jemma.dev/blog/esoteric-ruby-in-memowise)
|
239
263
|
|
240
264
|
## Logo
|
241
265
|
|
@@ -254,21 +278,27 @@ the [code of conduct](https://github.com/panorama-ed/memo_wise/blob/main/CODE_OF
|
|
254
278
|
## Releasing
|
255
279
|
|
256
280
|
To make a new release of `MemoWise` to
|
257
|
-
[RubyGems](https://rubygems.org/gems/memo_wise), first install the release
|
281
|
+
[RubyGems](https://rubygems.org/gems/memo_wise), first install the `release`
|
258
282
|
dependencies (e.g. `rake`) as follows:
|
259
283
|
|
260
284
|
```shell
|
261
|
-
bundle
|
262
|
-
bundle install
|
285
|
+
BUNDLE_WITH=release bundle install
|
263
286
|
```
|
264
287
|
|
265
288
|
Then carry out these steps:
|
266
289
|
|
267
290
|
1. Update `CHANGELOG.md`:
|
268
291
|
- Add an entry for the upcoming version _x.y.z_
|
269
|
-
- Add a link for this version's comparison to the bottom of `CHANGELOG.md`
|
270
292
|
- Move content from _Unreleased_ to the upcoming version _x.y.z_
|
271
|
-
-
|
293
|
+
- Update the diff links for this version and _Unreleased_ in `CHANGELOG.md`
|
294
|
+
- Change _Unreleased_ section to say:
|
295
|
+
```
|
296
|
+
**Gem enhancements:** none
|
297
|
+
|
298
|
+
_No breaking changes!_
|
299
|
+
|
300
|
+
**Project enhancements:** none
|
301
|
+
```
|
272
302
|
- Commit with title `Update CHANGELOG.md for x.y.z`
|
273
303
|
|
274
304
|
2. Update `lib/memo_wise/version.rb`
|