-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(result): add symbol for general way of detecting result
- Loading branch information
Showing
32 changed files
with
218 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
> rustresult Result.andThen: | ||
[ | ||
RustlikeResult { _type: 'ok', _value: 2, _error: undefined }, | ||
RustlikeResult { | ||
_type: 'ok', | ||
_value: 2, | ||
_error: undefined, | ||
_symbol: Symbol(rust_result) | ||
}, | ||
RustlikeResult { | ||
_type: 'err', | ||
_value: undefined, | ||
_error: 'error message' | ||
_error: 'error message', | ||
_symbol: Symbol(rust_result) | ||
} | ||
] | ||
|
||
> neverthrow Result.andThen: | ||
[ Ok { value: 2 }, Err { error: 'error message' } ] | ||
|
||
Loop N: 100,000 | ||
┌─────────┬─────────────────────────────┬─────────────────────┬─────────────────────┬────────────────┬───────────────┬─────────┐ | ||
│ (index) │ task │ mean (ns) │ median (ns) │ mean (op/s) │ median (op/s) │ samples │ | ||
├─────────┼─────────────────────────────┼─────────────────────┼─────────────────────┼────────────────┼───────────────┼─────────┤ | ||
│ 0 │ 'rustresult Result.andThen' │ '688856.68 ± 0.14%' │ '682300.09' │ '1453 ± 0.12%' │ '1466' │ 1452 │ | ||
│ 1 │ 'neverthrow Result.andThen' │ '460866.04 ± 0.34%' │ '446949.96 ± 49.83' │ '2180 ± 0.27%' │ '2237' │ 2170 │ | ||
└─────────┴─────────────────────────────┴─────────────────────┴─────────────────────┴────────────────┴───────────────┴─────────┘ | ||
┌─────────┬─────────────────────────────┬─────────────────────┬──────────────────────┬────────────────┬───────────────┬─────────┐ | ||
│ (index) │ task │ mean (ns) │ median (ns) │ mean (op/s) │ median (op/s) │ samples │ | ||
├─────────┼─────────────────────────────┼─────────────────────┼──────────────────────┼────────────────┼───────────────┼─────────┤ | ||
│ 0 │ 'rustresult Result.andThen' │ '738685.68 ± 0.19%' │ '729449.99 ± 149.97' │ '1355 ± 0.17%' │ '1371' │ 1354 │ | ||
│ 1 │ 'neverthrow Result.andThen' │ '466934.17 ± 0.34%' │ '452500.10' │ '2152 ± 0.28%' │ '2210' │ 2142 │ | ||
└─────────┴─────────────────────────────┴─────────────────────┴──────────────────────┴────────────────┴───────────────┴─────────┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.