-
Notifications
You must be signed in to change notification settings - Fork 197
Improve enum decoding -- alternative #981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
4878307
Improve enum decoding -- alternative
osa1 1f2064d
Merge remote-tracking branch 'origin/master' into improve_enum_decodi…
osa1 11cd8fd
Add sparse enum decoding benchmarks
osa1 947dee6
Merge branch 'sparse_enum_benchmarks' into improve_enum_decoding_2
osa1 856fc16
Merge remote-tracking branch 'origin/master' into improve_enum_decodi…
osa1 2f9478c
Update
osa1 7a833a0
Update
osa1 47b6f20
Fix
osa1 5638bb8
Fix a bug, add a test
osa1 f4ccab1
Fix bug
osa1 a9959c3
Fix warning
osa1 09603ac
Address comments
osa1 d09daf5
Remove redundnat isEmpty check
osa1 f758daa
Merge branch 'master' into improve_enum_decoding_2
osa1 a330fc4
Remove accidental whitespace change
osa1 2cc0faa
Rename for consistency
osa1 bf67804
Merge remote-tracking branch 'origin/master' into improve_enum_decodi…
osa1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| enum DenseEnum { | ||
| DENSE_ENUM_0 = 0; | ||
| DENSE_ENUM_1 = 1; | ||
| DENSE_ENUM_2 = 2; | ||
| DENSE_ENUM_3 = 3; | ||
| DENSE_ENUM_4 = 4; | ||
| } | ||
|
|
||
| enum DenseEnumOutOfOrder { | ||
| DENSE_ENUM_OOO_0 = 0; | ||
| DENSE_ENUM_OOO_2 = 2; | ||
| DENSE_ENUM_OOO_4 = 4; | ||
| DENSE_ENUM_OOO_3 = 3; | ||
| DENSE_ENUM_OOO_1 = 1; | ||
| } | ||
|
|
||
| enum SparseEnum { | ||
| SPARSE_ENUM_ZERO = 0; | ||
| SPARSE_ENUM_MIN_INT = -2147483648; | ||
| SPARSE_ENUM_1 = -1000000000; | ||
| SPARSE_ENUM_2 = -100000000; | ||
| SPARSE_ENUM_3 = -10000000; | ||
| SPARSE_ENUM_4 = -1000000; | ||
| SPARSE_ENUM_5 = -100000; | ||
| SPARSE_ENUM_6 = 100000; | ||
| SPARSE_ENUM_7 = 1000000; | ||
| SPARSE_ENUM_8 = 10000000; | ||
| SPARSE_ENUM_9 = 100000000; | ||
| SPARSE_ENUM_10 = 1000000000; | ||
| SPARSE_ENUM_MAX_INT = 2147483647; | ||
| } | ||
|
|
||
| enum SparseEnumOutOfOrder { | ||
| SPARSE_ENUM_OOO_ZERO = 0; | ||
| SPARSE_ENUM_OOO_1 = -1000000000; | ||
| SPARSE_ENUM_OOO_MAX_INT = 2147483647; | ||
| SPARSE_ENUM_OOO_4 = -1000000; | ||
| SPARSE_ENUM_OOO_6 = 100000; | ||
| SPARSE_ENUM_OOO_MIN_INT = -2147483648; | ||
| SPARSE_ENUM_OOO_7 = 1000000; | ||
| SPARSE_ENUM_OOO_5 = -100000; | ||
| SPARSE_ENUM_OOO_8 = 10000000; | ||
| SPARSE_ENUM_OOO_3 = -10000000; | ||
| SPARSE_ENUM_OOO_10 = 1000000000; | ||
| SPARSE_ENUM_OOO_2 = -100000000; | ||
| SPARSE_ENUM_OOO_9 = 100000000; | ||
| } | ||
|
|
||
| message MessageWithEnums { | ||
| repeated DenseEnum denseEnums = 1; | ||
| repeated DenseEnumOutOfOrder denseOutOfOrderEnums = 2; | ||
| repeated SparseEnum sparseEnums = 3; | ||
| repeated SparseEnumOutOfOrder sparseOutOfOrderEnums = 4; | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.