u-case 4.1.0 → 4.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +98 -96
- data/README.pt-BR.md +102 -100
- data/lib/micro/case.rb +18 -4
- data/lib/micro/case/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: feb30aaeb689640c0e2690c14e9f951896ced470bb3a9d31262c6441a37e3e57
|
4
|
+
data.tar.gz: 7fceb73bac6e4f6bc82558636679ad646c7c454e8ff516bb920632fb2e1c29a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27d50ac0ce1cb8129f752d181a5707bfe3ac8c2e2228448945d5d80b4b4cb7d6481b4b9a860bb9c686e34306c6aed0acb2a65fb507a807882f2de128bee7cfbd
|
7
|
+
data.tar.gz: 0fca08fe550b5519f3a754b529e2e636b04a9433be093219526fab694596d431950f308c5a4f322b0a7810ec63a448ce8feec230dab60d405465c57c19e5c8ea
|
data/README.md
CHANGED
@@ -39,7 +39,7 @@ 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.
|
42
|
+
4.1.1 | 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
|
@@ -102,7 +102,7 @@ unreleased| https://github.com/serradura/u-case/blob/main/README.md
|
|
102
102
|
| u-case | branch | ruby | activemodel | u-attributes |
|
103
103
|
| -------------- | ------- | -------- | ------------- | ------------ |
|
104
104
|
| unreleased | main | >= 2.2.0 | >= 3.2, < 6.1 | ~> 2.0 |
|
105
|
-
| 4.1.
|
105
|
+
| 4.1.1 | v4.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 2.0 |
|
106
106
|
| 3.1.0 | v3.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
|
107
107
|
| 2.6.0 | v2.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
|
108
108
|
| 1.1.0 | v1.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
|
@@ -1200,42 +1200,44 @@ end
|
|
1200
1200
|
|
1201
1201
|
| Gem / Abstraction | Iterations per second | Comparison |
|
1202
1202
|
| ----------------- | --------------------: | ----------------: |
|
1203
|
-
| Dry::Monads |
|
1204
|
-
| **Micro::Case** |
|
1205
|
-
| Interactor |
|
1206
|
-
| Trailblazer::Operation |
|
1207
|
-
| Dry::Transaction |
|
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.
|
1215
|
-
# Trailblazer::Operation
|
1216
|
-
#
|
1217
|
-
#
|
1218
|
-
#
|
1219
|
-
#
|
1220
|
-
#
|
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
|
1224
|
-
# Trailblazer::Operation
|
1225
|
-
#
|
1226
|
-
#
|
1227
|
-
#
|
1228
|
-
#
|
1229
|
-
#
|
1224
|
+
# Interactor 59.746k (±29.9%) i/s - 274.128k in 5.049901s
|
1225
|
+
# Trailblazer::Operation
|
1226
|
+
# 28.424k (±15.8%) i/s - 141.546k in 5.087882s
|
1227
|
+
# Dry::Monads 315.635k (± 6.1%) i/s - 1.588M in 5.048914s
|
1228
|
+
# Dry::Transaction 10.131k (± 6.4%) i/s - 50.694k in 5.025150s
|
1229
|
+
# Micro::Case 75.838k (± 9.7%) i/s - 379.728k in 5.052573s
|
1230
|
+
# Micro::Case::Safe 75.461k (±10.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:
|
1233
|
-
# Micro::Case:
|
1234
|
-
# Micro::Case::Safe:
|
1235
|
-
# Micro::Case::Strict:
|
1236
|
-
# Interactor:
|
1237
|
-
# Trailblazer::Operation:
|
1238
|
-
# Dry::Transaction:
|
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
|
-
|
|
1249
|
-
|
|
1250
|
-
| Trailblazer::Operation |
|
1251
|
-
| Interactor |
|
1252
|
-
| Dry::Transaction |
|
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.
|
1260
|
-
# Trailblazer::Operation
|
1261
|
-
# Dry::Monads 13.
|
1262
|
-
# Dry::Transaction
|
1263
|
-
# Micro::Case
|
1264
|
-
# Micro::Case::Safe
|
1265
|
-
# Micro::Case::Strict
|
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
|
1269
|
-
# Trailblazer::Operation
|
1270
|
-
# Dry::Monads
|
1271
|
-
# Dry::Transaction
|
1272
|
-
# Micro::Case
|
1273
|
-
# Micro::Case::Safe
|
1274
|
-
# Micro::Case::Strict
|
1270
|
+
# Interactor 27.037k (±24.9%) i/s - 128.674k in 5.102133s
|
1271
|
+
# Trailblazer::Operation 29.016k (±12.4%) i/s - 145.266k in 5.074991s
|
1272
|
+
# Dry::Monads 135.387k (±15.1%) i/s - 669.300k in 5.055356s
|
1273
|
+
# Dry::Transaction 8.989k (± 9.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.489k (± 9.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
|
-
#
|
1278
|
-
#
|
1279
|
-
# Micro::Case:
|
1280
|
-
# Micro::Case::Strict:
|
1281
|
-
# Trailblazer::Operation:
|
1282
|
-
# Interactor:
|
1283
|
-
# Dry::Transaction:
|
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 |
|
1296
|
-
| Micro::Case::Result `then` method |
|
1297
|
-
| Micro::Cases.flow |
|
1298
|
-
| Micro::Case class with an inner flow |
|
1299
|
-
| Micro::Case class including itself as a step|
|
1300
|
-
| Interactor::Organizer |
|
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
|
1310
|
-
# Micro::Cases.flow([])
|
1311
|
-
# Micro::Case flow in a class
|
1312
|
-
# Micro::Case including the class
|
1313
|
-
# Micro::Case::Result#|
|
1314
|
-
# Micro::Case::Result#then
|
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
|
1318
|
-
# Micro::Cases.flow([])
|
1319
|
-
# Micro::Case flow in a class
|
1320
|
-
# Micro::Case including the class
|
1321
|
-
# Micro::Case::Result#|
|
1322
|
-
# Micro::Case::Result#then
|
1319
|
+
# Interactor::Organizer 24.290k (±24.0%) i/s - 113.967k in 5.032825s
|
1320
|
+
# Micro::Cases.flow([]) 74.790k (±11.1%) i/s - 374.784k in 5.071740s
|
1321
|
+
# Micro::Case flow in a class 47.043k (± 8.0%) i/s - 235.984k in 5.047477s
|
1322
|
+
# Micro::Case including the class 42.030k (± 8.5%) i/s - 208.794k in 5.002138s
|
1323
|
+
# Micro::Case::Result#| 80.936k (±15.9%) i/s - 398.112k in 5.052531s
|
1324
|
+
# Micro::Case::Result#then 71.459k (± 8.8%) i/s - 356.900k in 5.030526s
|
1323
1325
|
|
1324
1326
|
# Comparison:
|
1325
|
-
# Micro::Case::Result#|:
|
1326
|
-
# Micro::
|
1327
|
-
# Micro::
|
1328
|
-
# Micro::Case flow in a class:
|
1329
|
-
# Micro::Case including the class:
|
1330
|
-
# Interactor::Organizer:
|
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
|
1340
|
-
# Micro::Cases.flow([])
|
1341
|
-
# Micro::Case flow in a class
|
1342
|
-
# Micro::Case including the class
|
1343
|
-
# Micro::Case::Result#|
|
1344
|
-
# Micro::Case::Result#then
|
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
|
1348
|
-
# Micro::Cases.flow([])
|
1349
|
-
# Micro::Case flow in a class
|
1350
|
-
# Micro::Case including the class
|
1351
|
-
# Micro::Case::Result#|
|
1352
|
-
# Micro::Case::Result#then
|
1349
|
+
# Interactor::Organizer 24.280k (±24.5%) i/s - 112.710k in 5.013334s
|
1350
|
+
# Micro::Cases.flow([]) 74.999k (± 9.8%) i/s - 375.750k in 5.055777s
|
1351
|
+
# Micro::Case flow in a class 46.681k (± 9.3%) i/s - 236.436k in 5.105105s
|
1352
|
+
# Micro::Case including the class 41.921k (± 8.9%) i/s - 209.814k in 5.043622s
|
1353
|
+
# Micro::Case::Result#| 78.280k (±12.6%) i/s - 386.988k in 5.022146s
|
1354
|
+
# Micro::Case::Result#then 68.898k (± 8.8%) i/s - 347.412k in 5.080116s
|
1353
1355
|
|
1354
1356
|
# Comparison:
|
1355
|
-
# Micro::Case::Result#|:
|
1356
|
-
# Micro::
|
1357
|
-
# Micro::
|
1358
|
-
# Micro::Case flow in a class:
|
1359
|
-
# Micro::Case including the class:
|
1360
|
-
# Interactor::Organizer:
|
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
|
|
data/README.pt-BR.md
CHANGED
@@ -39,7 +39,7 @@ Principais objetivos deste projeto:
|
|
39
39
|
Versão | Documentação
|
40
40
|
--------- | -------------
|
41
41
|
unreleased| https://github.com/serradura/u-case/blob/main/README.md
|
42
|
-
4.1.
|
42
|
+
4.1.1 | 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
|
@@ -100,7 +100,7 @@ unreleased| https://github.com/serradura/u-case/blob/main/README.md
|
|
100
100
|
|
101
101
|
| u-case | branch | ruby | activemodel | u-attributes |
|
102
102
|
| -------------- | ------- | -------- | ------------- | ------------ |
|
103
|
-
| 4.1.
|
103
|
+
| 4.1.1 | main | >= 2.2.0 | >= 3.2, < 6.1 | ~> 2.0 |
|
104
104
|
| 3.1.0 | v3.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
|
105
105
|
| 2.6.0 | v2.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
|
106
106
|
| 1.1.0 | v1.x | >= 2.2.0 | >= 3.2, < 6.1 | ~> 1.1 |
|
@@ -1201,44 +1201,46 @@ end
|
|
1201
1201
|
|
1202
1202
|
#### Success results
|
1203
1203
|
|
1204
|
-
| Gem / Abstração | Iterações por segundo |
|
1205
|
-
| ----------------- | --------------------: |
|
1206
|
-
| Dry::Monads |
|
1207
|
-
| **Micro::Case** |
|
1208
|
-
| Interactor |
|
1209
|
-
| Trailblazer::Operation |
|
1210
|
-
| Dry::Transaction |
|
1204
|
+
| Gem / Abstração | Iterações por segundo | Comparação |
|
1205
|
+
| ----------------- | --------------------: | -------------------: |
|
1206
|
+
| Dry::Monads | 315635.1 | _**O mais rápido**_ |
|
1207
|
+
| **Micro::Case** | 75837.7 | 4.16x mais lento |
|
1208
|
+
| Interactor | 59745.5 | 5.28x mais lento |
|
1209
|
+
| Trailblazer::Operation | 28423.9 | 11.10x mais lento |
|
1210
|
+
| Dry::Transaction | 10130.9 | 31.16x mais lento |
|
1211
1211
|
|
1212
1212
|
<details>
|
1213
1213
|
<summary>Show the full <a href="https://github.com/evanphx/benchmark-ips">benchmark/ips</a> results.</summary>
|
1214
1214
|
|
1215
1215
|
```ruby
|
1216
1216
|
# Warming up --------------------------------------
|
1217
|
-
# Interactor 5.
|
1218
|
-
# Trailblazer::Operation
|
1219
|
-
#
|
1220
|
-
#
|
1221
|
-
#
|
1222
|
-
#
|
1223
|
-
#
|
1217
|
+
# Interactor 5.711k i/100ms
|
1218
|
+
# Trailblazer::Operation
|
1219
|
+
# 2.283k i/100ms
|
1220
|
+
# Dry::Monads 31.130k i/100ms
|
1221
|
+
# Dry::Transaction 994.000 i/100ms
|
1222
|
+
# Micro::Case 7.911k i/100ms
|
1223
|
+
# Micro::Case::Safe 7.911k i/100ms
|
1224
|
+
# Micro::Case::Strict 6.248k i/100ms
|
1224
1225
|
|
1225
1226
|
# Calculating -------------------------------------
|
1226
|
-
# Interactor
|
1227
|
-
# Trailblazer::Operation
|
1228
|
-
#
|
1229
|
-
#
|
1230
|
-
#
|
1231
|
-
#
|
1232
|
-
#
|
1227
|
+
# Interactor 59.746k (±29.9%) i/s - 274.128k in 5.049901s
|
1228
|
+
# Trailblazer::Operation
|
1229
|
+
# 28.424k (±15.8%) i/s - 141.546k in 5.087882s
|
1230
|
+
# Dry::Monads 315.635k (± 6.1%) i/s - 1.588M in 5.048914s
|
1231
|
+
# Dry::Transaction 10.131k (± 6.4%) i/s - 50.694k in 5.025150s
|
1232
|
+
# Micro::Case 75.838k (± 9.7%) i/s - 379.728k in 5.052573s
|
1233
|
+
# Micro::Case::Safe 75.461k (±10.1%) i/s - 379.728k in 5.079238s
|
1234
|
+
# Micro::Case::Strict 64.235k (± 9.0%) i/s - 324.896k in 5.097028s
|
1233
1235
|
|
1234
1236
|
# Comparison:
|
1235
|
-
# Dry::Monads:
|
1236
|
-
# Micro::Case:
|
1237
|
-
# Micro::Case::Safe:
|
1238
|
-
# Micro::Case::Strict:
|
1239
|
-
# Interactor:
|
1240
|
-
# Trailblazer::Operation:
|
1241
|
-
# Dry::Transaction:
|
1237
|
+
# Dry::Monads: 315635.1 i/s
|
1238
|
+
# Micro::Case: 75837.7 i/s - 4.16x (± 0.00) slower
|
1239
|
+
# Micro::Case::Safe: 75461.3 i/s - 4.18x (± 0.00) slower
|
1240
|
+
# Micro::Case::Strict: 64234.9 i/s - 4.91x (± 0.00) slower
|
1241
|
+
# Interactor: 59745.5 i/s - 5.28x (± 0.00) slower
|
1242
|
+
# Trailblazer::Operation: 28423.9 i/s - 11.10x (± 0.00) slower
|
1243
|
+
# Dry::Transaction: 10130.9 i/s - 31.16x (± 0.00) slower
|
1242
1244
|
```
|
1243
1245
|
</details>
|
1244
1246
|
|
@@ -1246,44 +1248,44 @@ https://github.com/serradura/u-case/blob/main/benchmarks/perfomance/use_case/suc
|
|
1246
1248
|
|
1247
1249
|
#### Failure results
|
1248
1250
|
|
1249
|
-
| Gem / Abstração | Iterações por segundo |
|
1250
|
-
| ----------------- | --------------------: |
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
| Trailblazer::Operation |
|
1254
|
-
| Interactor |
|
1255
|
-
| Dry::Transaction |
|
1251
|
+
| Gem / Abstração | Iterações por segundo | Comparação |
|
1252
|
+
| ----------------- | --------------------: | -------------------: |
|
1253
|
+
| Dry::Monads | 135386.9 | _**O mais rápido**_ |
|
1254
|
+
| **Micro::Case** | 73489.3 | 1.85x mais lento |
|
1255
|
+
| Trailblazer::Operation | 29016.4 | 4.67x mais lento |
|
1256
|
+
| Interactor | 27037.0 | 5.01x mais lento |
|
1257
|
+
| Dry::Transaction | 8988.6 | 15.06x mais lento |
|
1256
1258
|
|
1257
1259
|
<details>
|
1258
1260
|
<summary>Mostrar o resultado completo do <a href="https://github.com/evanphx/benchmark-ips">benchmark/ips</a>.</summary>
|
1259
1261
|
|
1260
1262
|
```ruby
|
1261
1263
|
# Warming up --------------------------------------
|
1262
|
-
# Interactor 2.
|
1263
|
-
# Trailblazer::Operation
|
1264
|
-
# Dry::Monads 13.
|
1265
|
-
# Dry::Transaction
|
1266
|
-
# Micro::Case
|
1267
|
-
# Micro::Case::Safe
|
1268
|
-
# Micro::Case::Strict
|
1264
|
+
# Interactor 2.626k i/100ms
|
1265
|
+
# Trailblazer::Operation 2.343k i/100ms
|
1266
|
+
# Dry::Monads 13.386k i/100ms
|
1267
|
+
# Dry::Transaction 868.000 i/100ms
|
1268
|
+
# Micro::Case 7.603k i/100ms
|
1269
|
+
# Micro::Case::Safe 7.598k i/100ms
|
1270
|
+
# Micro::Case::Strict 6.178k i/100ms
|
1269
1271
|
|
1270
1272
|
# Calculating -------------------------------------
|
1271
|
-
# Interactor
|
1272
|
-
# Trailblazer::Operation
|
1273
|
-
# Dry::Monads
|
1274
|
-
# Dry::Transaction
|
1275
|
-
# Micro::Case
|
1276
|
-
# Micro::Case::Safe
|
1277
|
-
# Micro::Case::Strict
|
1273
|
+
# Interactor 27.037k (±24.9%) i/s - 128.674k in 5.102133s
|
1274
|
+
# Trailblazer::Operation 29.016k (±12.4%) i/s - 145.266k in 5.074991s
|
1275
|
+
# Dry::Monads 135.387k (±15.1%) i/s - 669.300k in 5.055356s
|
1276
|
+
# Dry::Transaction 8.989k (± 9.2%) i/s - 45.136k in 5.084820s
|
1277
|
+
# Micro::Case 73.247k (± 9.9%) i/s - 364.944k in 5.030449s
|
1278
|
+
# Micro::Case::Safe 73.489k (± 9.6%) i/s - 364.704k in 5.007282s
|
1279
|
+
# Micro::Case::Strict 61.980k (± 8.0%) i/s - 308.900k in 5.014821s
|
1278
1280
|
|
1279
1281
|
# Comparison:
|
1280
|
-
#
|
1281
|
-
#
|
1282
|
-
# Micro::Case:
|
1283
|
-
# Micro::Case::Strict:
|
1284
|
-
# Trailblazer::Operation:
|
1285
|
-
# Interactor:
|
1286
|
-
# Dry::Transaction:
|
1282
|
+
# Dry::Monads: 135386.9 i/s
|
1283
|
+
# Micro::Case::Safe: 73489.3 i/s - 1.84x (± 0.00) slower
|
1284
|
+
# Micro::Case: 73246.6 i/s - 1.85x (± 0.00) slower
|
1285
|
+
# Micro::Case::Strict: 61979.7 i/s - 2.18x (± 0.00) slower
|
1286
|
+
# Trailblazer::Operation: 29016.4 i/s - 4.67x (± 0.00) slower
|
1287
|
+
# Interactor: 27037.0 i/s - 5.01x (± 0.00) slower
|
1288
|
+
# Dry::Transaction: 8988.6 i/s - 15.06x (± 0.00) slower
|
1287
1289
|
```
|
1288
1290
|
</details>
|
1289
1291
|
|
@@ -1295,12 +1297,12 @@ https://github.com/serradura/u-case/blob/main/benchmarks/perfomance/use_case/fai
|
|
1295
1297
|
|
1296
1298
|
| Gem / Abstração | [Resultados de sucesso](https://github.com/serradura/u-case/blob/main/benchmarks/perfomance/flow/success_results.rb) | [Resultados de falha](https://github.com/serradura/u-case/blob/main/benchmarks/perfomance/flow/failure_results.rb) |
|
1297
1299
|
| ------------------------------------------- | ----------------: | ----------------: |
|
1298
|
-
| Micro::Case::Result `pipe` method |
|
1299
|
-
| Micro::Case::Result `then` method |
|
1300
|
-
| Micro::Cases.flow |
|
1301
|
-
| Micro::Case class with an inner flow |
|
1302
|
-
| Micro::Case class including itself as a step|
|
1303
|
-
| Interactor::Organizer |
|
1300
|
+
| Micro::Case::Result `pipe` method | 80936.2 i/s | 78280.4 i/s |
|
1301
|
+
| Micro::Case::Result `then` method | 0x mais lento | 0x mais lento |
|
1302
|
+
| Micro::Cases.flow | 0x mais lento | 0x mais lento |
|
1303
|
+
| Micro::Case class with an inner flow | 1.72x mais lento | 1.68x mais lento |
|
1304
|
+
| Micro::Case class including itself as a step| 1.93x mais lento | 1.87x mais lento |
|
1305
|
+
| Interactor::Organizer | 3.33x mais lento | 3.22x mais lento |
|
1304
1306
|
|
1305
1307
|
\* As gems `Dry::Monads`, `Dry::Transaction`, `Trailblazer::Operation` estão fora desta análise por não terem esse tipo de funcionalidade.
|
1306
1308
|
|
@@ -1309,28 +1311,28 @@ https://github.com/serradura/u-case/blob/main/benchmarks/perfomance/use_case/fai
|
|
1309
1311
|
|
1310
1312
|
```ruby
|
1311
1313
|
# Warming up --------------------------------------
|
1312
|
-
# Interactor::Organizer
|
1313
|
-
# Micro::Cases.flow([])
|
1314
|
-
# Micro::Case flow in a class
|
1315
|
-
# Micro::Case including the class
|
1316
|
-
# Micro::Case::Result#|
|
1317
|
-
# Micro::Case::Result#then
|
1314
|
+
# Interactor::Organizer 1.809k i/100ms
|
1315
|
+
# Micro::Cases.flow([]) 7.808k i/100ms
|
1316
|
+
# Micro::Case flow in a class 4.816k i/100ms
|
1317
|
+
# Micro::Case including the class 4.094k i/100ms
|
1318
|
+
# Micro::Case::Result#| 7.656k i/100ms
|
1319
|
+
# Micro::Case::Result#then 7.138k i/100ms
|
1318
1320
|
|
1319
1321
|
# Calculating -------------------------------------
|
1320
|
-
# Interactor::Organizer
|
1321
|
-
# Micro::Cases.flow([])
|
1322
|
-
# Micro::Case flow in a class
|
1323
|
-
# Micro::Case including the class
|
1324
|
-
# Micro::Case::Result#|
|
1325
|
-
# Micro::Case::Result#then
|
1322
|
+
# Interactor::Organizer 24.290k (±24.0%) i/s - 113.967k in 5.032825s
|
1323
|
+
# Micro::Cases.flow([]) 74.790k (±11.1%) i/s - 374.784k in 5.071740s
|
1324
|
+
# Micro::Case flow in a class 47.043k (± 8.0%) i/s - 235.984k in 5.047477s
|
1325
|
+
# Micro::Case including the class 42.030k (± 8.5%) i/s - 208.794k in 5.002138s
|
1326
|
+
# Micro::Case::Result#| 80.936k (±15.9%) i/s - 398.112k in 5.052531s
|
1327
|
+
# Micro::Case::Result#then 71.459k (± 8.8%) i/s - 356.900k in 5.030526s
|
1326
1328
|
|
1327
1329
|
# Comparison:
|
1328
|
-
# Micro::Case::Result#|:
|
1329
|
-
# Micro::
|
1330
|
-
# Micro::
|
1331
|
-
# Micro::Case flow in a class:
|
1332
|
-
# Micro::Case including the class:
|
1333
|
-
# Interactor::Organizer:
|
1330
|
+
# Micro::Case::Result#|: 80936.2 i/s
|
1331
|
+
# Micro::Cases.flow([]): 74790.1 i/s - same-ish: difference falls within error
|
1332
|
+
# Micro::Case::Result#then: 71459.5 i/s - same-ish: difference falls within error
|
1333
|
+
# Micro::Case flow in a class: 47042.6 i/s - 1.72x (± 0.00) slower
|
1334
|
+
# Micro::Case including the class: 42030.2 i/s - 1.93x (± 0.00) slower
|
1335
|
+
# Interactor::Organizer: 24290.3 i/s - 3.33x (± 0.00) slower
|
1334
1336
|
```
|
1335
1337
|
</details>
|
1336
1338
|
|
@@ -1339,28 +1341,28 @@ https://github.com/serradura/u-case/blob/main/benchmarks/perfomance/use_case/fai
|
|
1339
1341
|
|
1340
1342
|
```ruby
|
1341
1343
|
# Warming up --------------------------------------
|
1342
|
-
# Interactor::Organizer
|
1343
|
-
# Micro::Cases.flow([])
|
1344
|
-
# Micro::Case flow in a class
|
1345
|
-
# Micro::Case including the class
|
1346
|
-
# Micro::Case::Result#|
|
1347
|
-
# Micro::Case::Result#then
|
1344
|
+
# Interactor::Organizer 1.734k i/100ms
|
1345
|
+
# Micro::Cases.flow([]) 7.515k i/100ms
|
1346
|
+
# Micro::Case flow in a class 4.636k i/100ms
|
1347
|
+
# Micro::Case including the class 4.114k i/100ms
|
1348
|
+
# Micro::Case::Result#| 7.588k i/100ms
|
1349
|
+
# Micro::Case::Result#then 6.681k i/100ms
|
1348
1350
|
|
1349
1351
|
# Calculating -------------------------------------
|
1350
|
-
# Interactor::Organizer
|
1351
|
-
# Micro::Cases.flow([])
|
1352
|
-
# Micro::Case flow in a class
|
1353
|
-
# Micro::Case including the class
|
1354
|
-
# Micro::Case::Result#|
|
1355
|
-
# Micro::Case::Result#then
|
1352
|
+
# Interactor::Organizer 24.280k (±24.5%) i/s - 112.710k in 5.013334s
|
1353
|
+
# Micro::Cases.flow([]) 74.999k (± 9.8%) i/s - 375.750k in 5.055777s
|
1354
|
+
# Micro::Case flow in a class 46.681k (± 9.3%) i/s - 236.436k in 5.105105s
|
1355
|
+
# Micro::Case including the class 41.921k (± 8.9%) i/s - 209.814k in 5.043622s
|
1356
|
+
# Micro::Case::Result#| 78.280k (±12.6%) i/s - 386.988k in 5.022146s
|
1357
|
+
# Micro::Case::Result#then 68.898k (± 8.8%) i/s - 347.412k in 5.080116s
|
1356
1358
|
|
1357
1359
|
# Comparison:
|
1358
|
-
# Micro::Case::Result#|:
|
1359
|
-
# Micro::
|
1360
|
-
# Micro::
|
1361
|
-
# Micro::Case flow in a class:
|
1362
|
-
# Micro::Case including the class:
|
1363
|
-
# Interactor::Organizer:
|
1360
|
+
# Micro::Case::Result#|: 78280.4 i/s
|
1361
|
+
# Micro::Cases.flow([]): 74999.4 i/s - same-ish: difference falls within error
|
1362
|
+
# Micro::Case::Result#then: 68898.4 i/s - same-ish: difference falls within error
|
1363
|
+
# Micro::Case flow in a class: 46681.0 i/s - 1.68x (± 0.00) slower
|
1364
|
+
# Micro::Case including the class: 41920.8 i/s - 1.87x (± 0.00) slower
|
1365
|
+
# Interactor::Organizer: 24280.0 i/s - 3.22x (± 0.00) slower
|
1364
1366
|
```
|
1365
1367
|
</details>
|
1366
1368
|
|
data/lib/micro/case.rb
CHANGED
@@ -129,11 +129,25 @@ module Micro
|
|
129
129
|
__flow_set(__flow_use_cases_get) if !__flow_get__ && __flow_use_cases
|
130
130
|
end
|
131
131
|
|
132
|
+
InspectKey = :__inspect_key__ # :nodoc:
|
133
|
+
|
132
134
|
def self.inspect
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
135
|
+
ids = (Thread.current[InspectKey] ||= [])
|
136
|
+
|
137
|
+
if ids.include?(object_id)
|
138
|
+
return sprintf('#<%s: {...}>', self)
|
139
|
+
end
|
140
|
+
|
141
|
+
begin
|
142
|
+
ids << object_id
|
143
|
+
|
144
|
+
if __flow_use_cases
|
145
|
+
return '<%s (%s) use_cases=%s>' % [self, __flow_builder__, @__flow_use_cases]
|
146
|
+
else
|
147
|
+
return '<%s (%s) attributes=%s>' % [self, self.superclass, attributes]
|
148
|
+
end
|
149
|
+
ensure
|
150
|
+
ids.pop
|
137
151
|
end
|
138
152
|
end
|
139
153
|
|
data/lib/micro/case/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: u-case
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Serradura
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kind
|