-
Notifications
You must be signed in to change notification settings - Fork 489
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove unnecessary bounds for encoder and decoder derive ma…
…cro (#3030) Fixed a long standing tech debt around Encoder and Decoder derived macro. With this fix, no longer need to add bounds to struct as before: ``` pub struct Message<C> where C: Encoder + Decoder + Debug, { pub header: MsgType, pub content: C, } ``` Instead, this can be simplified: ``` pub struct Message<C> { pub header: MsgType, pub content: C, } ``` Forcing to add structure bounds cause downstream code to deal with extras bounds which make certain implementation difficult if not outright implementation In addition, tracing code is only added if enabled. This should only necessary in development. This will reduce some code and improve performance slightly. ``` #[derive(Encoder,Decoder,Default] #[fluvio(trace)] MyStruct { ... } ```
- Loading branch information
Showing
30 changed files
with
547 additions
and
245 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Oops, something went wrong.
cf09815
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
encode wasm file
299712
ns/iter (± 30335
)347897
ns/iter (± 39717
)0.86
This comment was automatically generated by workflow using github-action-benchmark.
cf09815
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
vecu8 encoding
335122
ns/iter (± 759381
)382067
ns/iter (± 719271
)0.88
vecu8 decoding
446384
ns/iter (± 186
)594623
ns/iter (± 30935
)0.75
bytebuf encoding
7228
ns/iter (± 188
)15353
ns/iter (± 636
)0.47
bytebuf decoding
6934
ns/iter (± 34
)15429
ns/iter (± 603
)0.45
This comment was automatically generated by workflow using github-action-benchmark.