Skip to content
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

Remove obsolete code in decode.go #786

Closed
fxamacker opened this issue Apr 9, 2021 · 1 comment
Closed

Remove obsolete code in decode.go #786

fxamacker opened this issue Apr 9, 2021 · 1 comment

Comments

@fxamacker
Copy link
Member

fxamacker commented Apr 9, 2021

Issue To Be Solved

Several type assertions in decode.go are not needed because they immediately follow a function that returns the desired type.

And decodeBig has obsolete code for v1 compatibility.

Suggestion

Remove type assertions that immediately follow a function call that returns the desired type.

Remove the obsolete code in decodeBig. The code was made obsolete by the recent decision to remove backward compatible decoding from the upcoming v4 decoder.

Context

Removal of these code blocks do not change v4 storage format.

Preliminary benchmark comparisons show speed gains of 3-4% decoding a 167 byte CBOR LinkValue.

Indirectly updates #738 because this was discovered while reviewing code to prepare for finalization of v4 storage format.

@fxamacker fxamacker changed the title Redundant code and obsolete code in decode.go can be removed Unneeded type assertion and obsolete code in decode.go can be removed Apr 9, 2021
fxamacker added a commit to fxamacker/cadence that referenced this issue Apr 9, 2021
@fxamacker fxamacker changed the title Unneeded type assertion and obsolete code in decode.go can be removed Remove obsolete code in decode.go Apr 9, 2021
turbolent pushed a commit that referenced this issue Apr 12, 2021
@turbolent
Copy link
Member

@fxamacker Is it OK to close this issue given that PR #788 was merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants