u-case 4.1.0 → 4.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e43c3e14dcb10002feb94f83f7d9289b49164e5908f3e8b58fa64e62d69796db
4
- data.tar.gz: 9f3a37d02e5e1c1369f74e8cdf14cc3038fad55df5db08bd1a330dd7004e5ba1
3
+ metadata.gz: a59c64287aa0ee26cc6b111f3d228dac413b5ea604216d20a5c039eece22f5c5
4
+ data.tar.gz: 70394e606e6c73a9c59c42dc3669434a2622e5d714923344576c339084ec31cb
5
5
  SHA512:
6
- metadata.gz: 744d7c78a228a3ae9197762f9e259dd72ab2f1b8c20af968fca4cbe46931c703abd9aa051c4aa0669b61f51b14d42a990834dc4fc34dc2f60a9f20d68867fbab
7
- data.tar.gz: 7da45bc3752296dd000bf016ef35ff7c993d0ea5c2218e43e6f1d492ec7d41f457e7048cf8b281d0ecb6f40efe05df19d07809d69db3a7a41df02f10028a7e68
6
+ metadata.gz: e8f15b3614af9ed23016b94010e341da7587beb90efd59eb5ae0c3528ebfa668a75f39c4b12e0dadd843e180a6e361719a8b99d547e356f5fa30f40c31994a68
7
+ data.tar.gz: 1528399ea74cd553526137f9a39f0a9dc18ab092fb0535dea33659e141ff6baf4ab1806b5963b1fe637e50d3f8157527a933444f2422ba5fc9f79b65f1f091cb
data/.travis.sh CHANGED
@@ -1,23 +1,46 @@
1
1
  #!/bin/bash
2
2
 
3
- ruby_v=$(ruby -v)
3
+ RUBY_V=$(ruby -v)
4
4
 
5
- ACTIVEMODEL_VERSION='3.2' bundle update
6
- ACTIVEMODEL_VERSION='3.2' ENABLE_TRANSITIONS='false' bundle exec rake test
7
- ACTIVEMODEL_VERSION='3.2' ENABLE_TRANSITIONS='true' bundle exec rake test
5
+ function run_with_bundler {
6
+ rm Gemfile.lock
8
7
 
9
- if [[ ! $ruby_v =~ '2.2.0' ]]; then
10
- ACTIVEMODEL_VERSION='5.2' bundle update
11
- ACTIVEMODEL_VERSION='5.2' ENABLE_TRANSITIONS='false' bundle exec rake test
12
- ACTIVEMODEL_VERSION='5.2' ENABLE_TRANSITIONS='true' bundle exec rake test
13
- fi
8
+ if [ ! -z "$1" ]; then
9
+ bundle_cmd="bundle _$1_"
10
+ else
11
+ bundle_cmd="bundle"
12
+ fi
13
+
14
+ eval "$2 $bundle_cmd update"
15
+ eval "$2 ENABLE_TRANSITIONS=true $bundle_cmd exec rake test"
16
+ eval "$2 ENABLE_TRANSITIONS=false $bundle_cmd exec rake test"
17
+ }
18
+
19
+ function run_with_ar_version_and_bundler {
20
+ run_with_bundler "$2" "ACTIVERECORD_VERSION=$1"
21
+ }
22
+
23
+ RUBY_2_2345="ruby 2.[2345]."
14
24
 
15
- if [[ $ruby_v =~ '2.5.' ]] || [[ $ruby_v =~ '2.6.' ]] || [[ $ruby_v =~ '2.7.' ]]; then
16
- ACTIVEMODEL_VERSION='6.0' bundle update
17
- ACTIVEMODEL_VERSION='6.0' ENABLE_TRANSITIONS='false' bundle exec rake test
18
- ACTIVEMODEL_VERSION='6.0' ENABLE_TRANSITIONS='true' bundle exec rake test
25
+ if [[ $RUBY_V =~ $RUBY_2_2345 ]]; then
26
+ run_with_bundler "$BUNDLER_V1"
27
+
28
+ run_with_ar_version_and_bundler "3.2" "$BUNDLER_V1"
29
+ run_with_ar_version_and_bundler "4.0" "$BUNDLER_V1"
30
+ run_with_ar_version_and_bundler "4.1" "$BUNDLER_V1"
31
+ run_with_ar_version_and_bundler "4.2" "$BUNDLER_V1"
32
+ run_with_ar_version_and_bundler "5.0" "$BUNDLER_V1"
33
+ run_with_ar_version_and_bundler "5.1" "$BUNDLER_V1"
34
+ run_with_ar_version_and_bundler "5.2" "$BUNDLER_V1"
19
35
  fi
20
36
 
21
- bundle update
22
- ENABLE_TRANSITIONS='false' bundle exec rake test
23
- ENABLE_TRANSITIONS='true' bundle exec rake test
37
+ RUBY_2_567="ruby 2.[567]."
38
+ RUBY_3_x_x="ruby 3.0."
39
+
40
+ if [[ $RUBY_V =~ $RUBY_2_567 ]] || [[ $RUBY_V =~ $RUBY_3_x_x ]]; then
41
+ gem install bundler -v ">= 2" --no-doc
42
+
43
+ run_with_bundler
44
+ run_with_ar_version_and_bundler "6.0"
45
+ run_with_ar_version_and_bundler "6.1"
46
+ fi
data/.travis.yml CHANGED
@@ -1,21 +1,24 @@
1
-
2
1
  language: ruby
3
2
 
4
- sudo: false
3
+ cache:
4
+ bundler: true
5
+ directories:
6
+ - /home/travis/.rvm/
5
7
 
6
8
  rvm:
7
- - 2.2.0
9
+ - 2.2.2
8
10
  - 2.3.0
9
11
  - 2.4.0
10
12
  - 2.5.0
11
13
  - 2.6.0
12
14
  - 2.7.0
15
+ - 3.0.0
13
16
 
14
- cache: bundler
17
+ env:
18
+ - BUNDLER_V1="1.17.3"
15
19
 
16
20
  before_install:
17
- - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
18
- - gem install bundler -v '< 2'
21
+ - gem install bundler -v "$BUNDLER_V1"
19
22
 
20
23
  install: bundle install --jobs=3 --retry=3
21
24
 
data/Gemfile CHANGED
@@ -2,19 +2,20 @@ source "https://rubygems.org"
2
2
 
3
3
  git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
- activemodel_version = ENV.fetch('ACTIVEMODEL_VERSION', '6.1.0')
5
+ activerecord_version = ENV.fetch('ACTIVERECORD_VERSION', '7')
6
6
 
7
- activemodel = case activemodel_version
7
+ activerecord = case activerecord_version
8
8
  when '3.2' then '3.2.22'
9
- when '5.2' then '5.2.3'
10
- when '6.0' then '6.0.2'
9
+ when '4.0' then '4.0.13'
10
+ when '4.1' then '4.1.16'
11
+ when '4.2' then '4.2.11'
12
+ when '5.0' then '5.0.7'
13
+ when '5.1' then '5.1.7'
14
+ when '5.2' then '5.2.4'
15
+ when '6.0' then '6.0.3.4'
16
+ when '6.1' then '6.1.2'
11
17
  end
12
18
 
13
- if activemodel_version < '6.1.0'
14
- gem 'activemodel', activemodel, require: false
15
- gem 'activesupport', activemodel, require: false
16
- end
17
-
18
19
  simplecov_version =
19
20
  case RUBY_VERSION
20
21
  when /\A2.[23]/ then '~> 0.17.1'
@@ -23,9 +24,20 @@ simplecov_version =
23
24
  end
24
25
 
25
26
  group :test do
26
- gem 'minitest', activemodel_version < '4.1' ? '~> 4.2' : '~> 5.0'
27
+ gem 'minitest', activerecord_version < '4.1' ? '~> 4.2' : '~> 5.0'
27
28
 
28
29
  gem 'simplecov', simplecov_version, require: false
30
+
31
+ if activerecord
32
+ sqlite3 =
33
+ case activerecord
34
+ when /\A6\.(0|1)/, nil then '~> 1.4.0'
35
+ else '~> 1.3.0'
36
+ end
37
+
38
+ gem 'sqlite3', sqlite3
39
+ gem 'activerecord', activerecord, require: 'active_record'
40
+ end
29
41
  end
30
42
 
31
43
  pry_byebug_version =
data/README.md CHANGED
@@ -39,12 +39,12 @@ The main project goals are:
39
39
  Version | Documentation
40
40
  --------- | -------------
41
41
  unreleased| https://github.com/serradura/u-case/blob/main/README.md
42
- 4.1.0 | https://github.com/serradura/u-case/blob/v4.x/README.md
42
+ 4.3.0 | https://github.com/serradura/u-case/blob/v4.x/README.md
43
43
  3.1.0 | https://github.com/serradura/u-case/blob/v3.x/README.md
44
44
  2.6.0 | https://github.com/serradura/u-case/blob/v2.x/README.md
45
45
  1.1.0 | https://github.com/serradura/u-case/blob/v1.x/README.md
46
46
 
47
- > **Note:** Você entende português? 🇧🇷🇵🇹 Verifique o [README traduzido em pt-BR](https://github.com/serradura/u-case/blob/main/README.pt-BR.md).
47
+ > **Note:** Você entende português? 🇧🇷&nbsp;🇵🇹 Verifique o [README traduzido em pt-BR](https://github.com/serradura/u-case/blob/main/README.pt-BR.md).
48
48
 
49
49
  ## Table of Contents <!-- omit in toc -->
50
50
  - [Compatibility](#compatibility)
@@ -99,13 +99,13 @@ unreleased| https://github.com/serradura/u-case/blob/main/README.md
99
99
 
100
100
  ## Compatibility
101
101
 
102
- | u-case | branch | ruby | activemodel | u-attributes |
103
- | -------------- | ------- | -------- | ------------- | ------------ |
104
- | unreleased | main | >= 2.2.0 | >= 3.2, < 6.1 | ~> 2.0 |
105
- | 4.1.0 | v4.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 2.0 |
106
- | 3.1.0 | v3.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
107
- | 2.6.0 | v2.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
108
- | 1.1.0 | v1.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
102
+ | u-case | branch | ruby | activemodel | u-attributes |
103
+ | -------------- | ------- | -------- | ------------- | ------------- |
104
+ | unreleased | main | >= 2.2.0 | >= 3.2, < 7.0 | >= 2.7, < 3.0 |
105
+ | 4.3.0 | v4.x | >= 2.2.0 | >= 3.2, < 7.0 | >= 2.7, < 3.0 |
106
+ | 3.1.0 | v3.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
107
+ | 2.6.0 | v2.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
108
+ | 1.1.0 | v1.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
109
109
 
110
110
  > Note: The activemodel is an optional dependency, this module [can be enabled](#u-casewith_activemodel_validation---how-to-validate-use-case-attributes) to validate the use cases' attributes.
111
111
 
@@ -115,7 +115,7 @@ unreleased| https://github.com/serradura/u-case/blob/main/README.md
115
115
 
116
116
  A simple type system (at runtime) for Ruby.
117
117
 
118
- It is used to validate some internal u-case's methods input. This gem also exposes an [`ActiveModel validator`](https://github.com/serradura/kind#kindvalidator-activemodelvalidations) when requiring the [`u-case/with_activemodel_validation`](#u-casewith_activemodel_validation---how-to-validate-use-case-attributes) module, or when the [`Micro::Case.config`](#microcaseconfig) was used to enable it. Lastly, two type checkers are available through it: [`Kind::Of::Micro::Case`, `Kind::Of::Micro::Case::Result`](https://github.com/serradura/kind#registering-new-custom-type-checker).
118
+ It is used to validate some internal u-case's methods input. This gem also exposes an [`ActiveModel validator`](https://github.com/serradura/kind#kindvalidator-activemodelvalidations) when requiring the [`u-case/with_activemodel_validation`](#u-casewith_activemodel_validation---how-to-validate-use-case-attributes) module, or when the [`Micro::Case.config`](#microcaseconfig) was used to enable it.
119
119
  2. [`u-attributes`](https://github.com/serradura/u-attributes) gem.
120
120
 
121
121
  This gem allows defining read-only attributes, that is, your objects will have only getters to access their attributes data.
@@ -1052,8 +1052,8 @@ Divide
1052
1052
  # Can't divide a number by 0
1053
1053
  # Oh no, something went wrong!
1054
1054
 
1055
- Divide.
1056
- .call(a: 2, b: '2').
1055
+ Divide
1056
+ .call(a: 2, b: '2')
1057
1057
  .on_success { |result| puts result[:division] }
1058
1058
  .on_exception(TypeError) { puts 'Please, use only numeric attributes.' }
1059
1059
  .on_exception(ZeroDivisionError) { |_error| puts "Can't divide a number by 0." }
@@ -1200,42 +1200,44 @@ end
1200
1200
 
1201
1201
  | Gem / Abstraction | Iterations per second | Comparison |
1202
1202
  | ----------------- | --------------------: | ----------------: |
1203
- | Dry::Monads | 281515.4 | _**The Fastest**_ |
1204
- | **Micro::Case** | 151711.3 | 1.86x slower |
1205
- | Interactor | 53016.2 | 5.31x slower |
1206
- | Trailblazer::Operation | 38314.2 | 7.35x slower |
1207
- | Dry::Transaction | 10440.7 | 26.96x slower |
1203
+ | Dry::Monads | 315635.1 | _**The Fastest**_ |
1204
+ | **Micro::Case** | 75837.7 | 4.16x slower |
1205
+ | Interactor | 59745.5 | 5.28x slower |
1206
+ | Trailblazer::Operation | 28423.9 | 11.10x slower |
1207
+ | Dry::Transaction | 10130.9 | 31.16x slower |
1208
1208
 
1209
1209
  <details>
1210
1210
  <summary>Show the full <a href="https://github.com/evanphx/benchmark-ips">benchmark/ips</a> results.</summary>
1211
1211
 
1212
1212
  ```ruby
1213
1213
  # Warming up --------------------------------------
1214
- # Interactor 5.151k i/100ms
1215
- # Trailblazer::Operation 3.805k i/100ms
1216
- # Dry::Monads 28.153k i/100ms
1217
- # Dry::Transaction 1.063k i/100ms
1218
- # Micro::Case 15.159k i/100ms
1219
- # Micro::Case::Safe 15.172k i/100ms
1220
- # Micro::Case::Strict 12.557k i/100ms
1214
+ # Interactor 5.711k i/100ms
1215
+ # Trailblazer::Operation
1216
+ # 2.283k i/100ms
1217
+ # Dry::Monads 31.130k i/100ms
1218
+ # Dry::Transaction 994.000 i/100ms
1219
+ # Micro::Case 7.911k i/100ms
1220
+ # Micro::Case::Safe 7.911k i/100ms
1221
+ # Micro::Case::Strict 6.248k i/100ms
1221
1222
 
1222
1223
  # Calculating -------------------------------------
1223
- # Interactor 53.016k 1.8%) i/s - 267.852k in 5.053967s
1224
- # Trailblazer::Operation 38.314k (± 1.7%) i/s - 194.055k in 5.066374s
1225
- # Dry::Monads 281.515k 2.4%) i/s - 1.408M in 5.003266s
1226
- # Dry::Transaction 10.441k2.1%) i/s - 53.150k in 5.092957s
1227
- # Micro::Case 151.711k1.7%) i/s - 773.109k in 5.097555s
1228
- # Micro::Case::Safe 145.801k6.7%) i/s - 728.256k in 5.022666s
1229
- # Micro::Case::Strict 115.636k 8.4%) i/s - 577.622k in 5.042079s
1224
+ # Interactor 59.746k29.9%) i/s - 274.128k in 5.049901s
1225
+ # Trailblazer::Operation
1226
+ # 28.424k15.8%) i/s - 141.546k in 5.087882s
1227
+ # Dry::Monads 315.635k6.1%) i/s - 1.588M in 5.048914s
1228
+ # Dry::Transaction 10.131k6.4%) i/s - 50.694k in 5.025150s
1229
+ # Micro::Case 75.838k9.7%) i/s - 379.728k in 5.052573s
1230
+ # Micro::Case::Safe 75.461k10.1%) i/s - 379.728k in 5.079238s
1231
+ # Micro::Case::Strict 64.235k (± 9.0%) i/s - 324.896k in 5.097028s
1230
1232
 
1231
1233
  # Comparison:
1232
- # Dry::Monads: 281515.4 i/s
1233
- # Micro::Case: 151711.3 i/s - 1.86x (± 0.00) slower
1234
- # Micro::Case::Safe: 145800.8 i/s - 1.93x (± 0.00) slower
1235
- # Micro::Case::Strict: 115635.8 i/s - 2.43x (± 0.00) slower
1236
- # Interactor: 53016.2 i/s - 5.31x (± 0.00) slower
1237
- # Trailblazer::Operation: 38314.2 i/s - 7.35x (± 0.00) slower
1238
- # Dry::Transaction: 10440.7 i/s - 26.96x (± 0.00) slower
1234
+ # Dry::Monads: 315635.1 i/s
1235
+ # Micro::Case: 75837.7 i/s - 4.16x (± 0.00) slower
1236
+ # Micro::Case::Safe: 75461.3 i/s - 4.18x (± 0.00) slower
1237
+ # Micro::Case::Strict: 64234.9 i/s - 4.91x (± 0.00) slower
1238
+ # Interactor: 59745.5 i/s - 5.28x (± 0.00) slower
1239
+ # Trailblazer::Operation: 28423.9 i/s - 11.10x (± 0.00) slower
1240
+ # Dry::Transaction: 10130.9 i/s - 31.16x (± 0.00) slower
1239
1241
  ```
1240
1242
  </details>
1241
1243
 
@@ -1245,42 +1247,42 @@ https://github.com/serradura/u-case/blob/main/benchmarks/perfomance/use_case/suc
1245
1247
 
1246
1248
  | Gem / Abstraction | Iterations per second | Comparison |
1247
1249
  | ----------------- | --------------------: | ----------------: |
1248
- | **Micro::Case** | 140794.0 | _**The Fastest**_ |
1249
- | Dry::Monads | 133865.5 | 0x slower |
1250
- | Trailblazer::Operation | 39829.9 | 3.53x slower |
1251
- | Interactor | 23856.0 | 5.90x slower |
1252
- | Dry::Transaction | 7975.0 | 17.65x slower |
1250
+ | Dry::Monads | 135386.9 | _**The Fastest**_ |
1251
+ | **Micro::Case** | 73489.3 | 1.85x slower |
1252
+ | Trailblazer::Operation | 29016.4 | 4.67x slower |
1253
+ | Interactor | 27037.0 | 5.01x slower |
1254
+ | Dry::Transaction | 8988.6 | 15.06x slower |
1253
1255
 
1254
1256
  <details>
1255
1257
  <summary>Show the full <a href="https://github.com/evanphx/benchmark-ips">benchmark/ips</a> results.</summary>
1256
1258
 
1257
1259
  ```ruby
1258
1260
  # Warming up --------------------------------------
1259
- # Interactor 2.351k i/100ms
1260
- # Trailblazer::Operation 3.941k i/100ms
1261
- # Dry::Monads 13.567k i/100ms
1262
- # Dry::Transaction 927.000 i/100ms
1263
- # Micro::Case 14.959k i/100ms
1264
- # Micro::Case::Safe 14.904k i/100ms
1265
- # Micro::Case::Strict 12.007k i/100ms
1261
+ # Interactor 2.626k i/100ms
1262
+ # Trailblazer::Operation 2.343k i/100ms
1263
+ # Dry::Monads 13.386k i/100ms
1264
+ # Dry::Transaction 868.000 i/100ms
1265
+ # Micro::Case 7.603k i/100ms
1266
+ # Micro::Case::Safe 7.598k i/100ms
1267
+ # Micro::Case::Strict 6.178k i/100ms
1266
1268
 
1267
1269
  # Calculating -------------------------------------
1268
- # Interactor 23.856k 1.7%) i/s - 119.901k in 5.027585s
1269
- # Trailblazer::Operation 39.830k 1.2%) i/s - 200.991k in 5.047032s
1270
- # Dry::Monads 133.866k 2.5%) i/s - 678.350k in 5.070899s
1271
- # Dry::Transaction 7.975k8.6%) i/s - 39.861k in 5.036260s
1272
- # Micro::Case 130.534k24.4%) i/s - 583.401k in 5.040907s
1273
- # Micro::Case::Safe 140.794k8.1%) i/s - 700.488k in 5.020935s
1274
- # Micro::Case::Strict 102.641k21.3%) i/s - 480.280k in 5.020354s
1270
+ # Interactor 27.037k24.9%) i/s - 128.674k in 5.102133s
1271
+ # Trailblazer::Operation 29.016k12.4%) i/s - 145.266k in 5.074991s
1272
+ # Dry::Monads 135.387k15.1%) i/s - 669.300k in 5.055356s
1273
+ # Dry::Transaction 8.989k9.2%) i/s - 45.136k in 5.084820s
1274
+ # Micro::Case 73.247k 9.9%) i/s - 364.944k in 5.030449s
1275
+ # Micro::Case::Safe 73.489k9.6%) i/s - 364.704k in 5.007282s
1276
+ # Micro::Case::Strict 61.980k 8.0%) i/s - 308.900k in 5.014821s
1275
1277
 
1276
1278
  # Comparison:
1277
- # Micro::Case::Safe: 140794.0 i/s
1278
- # Dry::Monads: 133865.5 i/s - same-ish: difference falls within error
1279
- # Micro::Case: 130534.0 i/s - same-ish: difference falls within error
1280
- # Micro::Case::Strict: 102640.7 i/s - 1.37x (± 0.00) slower
1281
- # Trailblazer::Operation: 39829.9 i/s - 3.53x (± 0.00) slower
1282
- # Interactor: 23856.0 i/s - 5.90x (± 0.00) slower
1283
- # Dry::Transaction: 7975.0 i/s - 17.65x (± 0.00) slower
1279
+ # Dry::Monads: 135386.9 i/s
1280
+ # Micro::Case::Safe: 73489.3 i/s - 1.84x (± 0.00) slower
1281
+ # Micro::Case: 73246.6 i/s - 1.85x (± 0.00) slower
1282
+ # Micro::Case::Strict: 61979.7 i/s - 2.18x (± 0.00) slower
1283
+ # Trailblazer::Operation: 29016.4 i/s - 4.67x (± 0.00) slower
1284
+ # Interactor: 27037.0 i/s - 5.01x (± 0.00) slower
1285
+ # Dry::Transaction: 8988.6 i/s - 15.06x (± 0.00) slower
1284
1286
  ```
1285
1287
  </details>
1286
1288
 
@@ -1292,12 +1294,12 @@ https://github.com/serradura/u-case/blob/main/benchmarks/perfomance/use_case/fai
1292
1294
 
1293
1295
  | Gems / Abstraction | [Success results](https://github.com/serradura/u-case/blob/main/benchmarks/perfomance/flow/success_results.rb) | [Failure results](https://github.com/serradura/u-case/blob/main/benchmarks/perfomance/flow/failure_results.rb) |
1294
1296
  | ------------------------------------------- | ----------------: | ----------------: |
1295
- | Micro::Case::Result `pipe` method | 172734.4 i/s | 153745.6 i/s |
1296
- | Micro::Case::Result `then` method | 1.24x slower | 1.21x slower |
1297
- | Micro::Cases.flow | 1.30x slower | 1.30x slower |
1298
- | Micro::Case class with an inner flow | 2.05x slower | 1.98x slower |
1299
- | Micro::Case class including itself as a step| 2.14x slower | 2.09x slower |
1300
- | Interactor::Organizer | 7.69x slower | 7.03x slower |
1297
+ | Micro::Case::Result `pipe` method | 80936.2 i/s | 78280.4 i/s |
1298
+ | Micro::Case::Result `then` method | 0x slower | 0x slower |
1299
+ | Micro::Cases.flow | 0x slower | 0x slower |
1300
+ | Micro::Case class with an inner flow | 1.72x slower | 1.68x slower |
1301
+ | Micro::Case class including itself as a step| 1.93x slower | 1.87x slower |
1302
+ | Interactor::Organizer | 3.33x slower | 3.22x slower |
1301
1303
 
1302
1304
  \* The `Dry::Monads`, `Dry::Transaction`, `Trailblazer::Operation` gems are out of this analysis because all of them doesn't have this kind of feature.
1303
1305
 
@@ -1306,28 +1308,28 @@ https://github.com/serradura/u-case/blob/main/benchmarks/perfomance/use_case/fai
1306
1308
 
1307
1309
  ```ruby
1308
1310
  # Warming up --------------------------------------
1309
- # Interactor::Organizer 2.163k i/100ms
1310
- # Micro::Cases.flow([]) 13.158k i/100ms
1311
- # Micro::Case flow in a class 8.400k i/100ms
1312
- # Micro::Case including the class 8.008k i/100ms
1313
- # Micro::Case::Result#| 17.151k i/100ms
1314
- # Micro::Case::Result#then 14.121k i/100ms
1311
+ # Interactor::Organizer 1.809k i/100ms
1312
+ # Micro::Cases.flow([]) 7.808k i/100ms
1313
+ # Micro::Case flow in a class 4.816k i/100ms
1314
+ # Micro::Case including the class 4.094k i/100ms
1315
+ # Micro::Case::Result#| 7.656k i/100ms
1316
+ # Micro::Case::Result#then 7.138k i/100ms
1315
1317
 
1316
1318
  # Calculating -------------------------------------
1317
- # Interactor::Organizer 22.467k 1.8%) i/s - 112.476k in 5.007787s
1318
- # Micro::Cases.flow([]) 133.183k 1.5%) i/s - 671.058k in 5.039815s
1319
- # Micro::Case flow in a class 84.083k1.8%) i/s - 428.400k in 5.096623s
1320
- # Micro::Case including the class 80.574k1.6%) i/s - 408.408k in 5.070029s
1321
- # Micro::Case::Result#| 172.734k 1.1%) i/s - 874.701k in 5.064429s
1322
- # Micro::Case::Result#then 139.799k1.7%) i/s - 706.050k in 5.052035s
1319
+ # Interactor::Organizer 24.290k24.0%) i/s - 113.967k in 5.032825s
1320
+ # Micro::Cases.flow([]) 74.790k11.1%) i/s - 374.784k in 5.071740s
1321
+ # Micro::Case flow in a class 47.043k8.0%) i/s - 235.984k in 5.047477s
1322
+ # Micro::Case including the class 42.030k8.5%) i/s - 208.794k in 5.002138s
1323
+ # Micro::Case::Result#| 80.936k15.9%) i/s - 398.112k in 5.052531s
1324
+ # Micro::Case::Result#then 71.459k8.8%) i/s - 356.900k in 5.030526s
1323
1325
 
1324
1326
  # Comparison:
1325
- # Micro::Case::Result#|: 172734.4 i/s
1326
- # Micro::Case::Result#then: 139799.0 i/s - 1.24x (± 0.00) slower
1327
- # Micro::Cases.flow([]): 133182.9 i/s - 1.30x (± 0.00) slower
1328
- # Micro::Case flow in a class: 84082.6 i/s - 2.05x (± 0.00) slower
1329
- # Micro::Case including the class: 80574.3 i/s - 2.14x (± 0.00) slower
1330
- # Interactor::Organizer: 22467.4 i/s - 7.69x (± 0.00) slower
1327
+ # Micro::Case::Result#|: 80936.2 i/s
1328
+ # Micro::Cases.flow([]): 74790.1 i/s - same-ish: difference falls within error
1329
+ # Micro::Case::Result#then: 71459.5 i/s - same-ish: difference falls within error
1330
+ # Micro::Case flow in a class: 47042.6 i/s - 1.72x (± 0.00) slower
1331
+ # Micro::Case including the class: 42030.2 i/s - 1.93x (± 0.00) slower
1332
+ # Interactor::Organizer: 24290.3 i/s - 3.33x (± 0.00) slower
1331
1333
  ```
1332
1334
  </details>
1333
1335
 
@@ -1336,28 +1338,28 @@ https://github.com/serradura/u-case/blob/main/benchmarks/perfomance/use_case/fai
1336
1338
 
1337
1339
  ```ruby
1338
1340
  # Warming up --------------------------------------
1339
- # Interactor::Organizer 2.167k i/100ms
1340
- # Micro::Cases.flow([]) 11.797k i/100ms
1341
- # Micro::Case flow in a class 7.783k i/100ms
1342
- # Micro::Case including the class 7.097k i/100ms
1343
- # Micro::Case::Result#| 14.398k i/100ms
1344
- # Micro::Case::Result#then 12.719k i/100ms
1341
+ # Interactor::Organizer 1.734k i/100ms
1342
+ # Micro::Cases.flow([]) 7.515k i/100ms
1343
+ # Micro::Case flow in a class 4.636k i/100ms
1344
+ # Micro::Case including the class 4.114k i/100ms
1345
+ # Micro::Case::Result#| 7.588k i/100ms
1346
+ # Micro::Case::Result#then 6.681k i/100ms
1345
1347
 
1346
1348
  # Calculating -------------------------------------
1347
- # Interactor::Organizer 21.863k 2.5%) i/s - 110.517k in 5.058420s
1348
- # Micro::Cases.flow([]) 118.124k1.8%) i/s - 601.647k in 5.095102s
1349
- # Micro::Case flow in a class 77.801k1.5%) i/s - 389.150k in 5.003002s
1350
- # Micro::Case including the class 73.533k2.1%) i/s - 369.044k in 5.021076s
1351
- # Micro::Case::Result#| 153.746k 1.5%) i/s - 777.492k in 5.058177s
1352
- # Micro::Case::Result#then 126.897k1.7%) i/s - 635.950k in 5.013059s
1349
+ # Interactor::Organizer 24.280k24.5%) i/s - 112.710k in 5.013334s
1350
+ # Micro::Cases.flow([]) 74.999k9.8%) i/s - 375.750k in 5.055777s
1351
+ # Micro::Case flow in a class 46.681k9.3%) i/s - 236.436k in 5.105105s
1352
+ # Micro::Case including the class 41.921k8.9%) i/s - 209.814k in 5.043622s
1353
+ # Micro::Case::Result#| 78.280k12.6%) i/s - 386.988k in 5.022146s
1354
+ # Micro::Case::Result#then 68.898k8.8%) i/s - 347.412k in 5.080116s
1353
1355
 
1354
1356
  # Comparison:
1355
- # Micro::Case::Result#|: 153745.6 i/s
1356
- # Micro::Case::Result#then: 126896.6 i/s - 1.21x (± 0.00) slower
1357
- # Micro::Cases.flow([]): 118123.9 i/s - 1.30x (± 0.00) slower
1358
- # Micro::Case flow in a class: 77800.7 i/s - 1.98x (± 0.00) slower
1359
- # Micro::Case including the class: 73532.9 i/s - 2.09x (± 0.00) slower
1360
- # Interactor::Organizer: 21862.9 i/s - 7.03x (± 0.00) slower
1357
+ # Micro::Case::Result#|: 78280.4 i/s
1358
+ # Micro::Cases.flow([]): 74999.4 i/s - same-ish: difference falls within error
1359
+ # Micro::Case::Result#then: 68898.4 i/s - same-ish: difference falls within error
1360
+ # Micro::Case flow in a class: 46681.0 i/s - 1.68x (± 0.00) slower
1361
+ # Micro::Case including the class: 41920.8 i/s - 1.87x (± 0.00) slower
1362
+ # Interactor::Organizer: 24280.0 i/s - 3.22x (± 0.00) slower
1361
1363
  ```
1362
1364
  </details>
1363
1365