-
Notifications
You must be signed in to change notification settings - Fork 138
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
Avoid unnecessary static to sema type conversions for Type
#2750
Conversation
avoid unnecessary need for conversion to sema type
…ema type to get type ID
…to sema type to get type ID
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:master commit bd3056f Collapsed results for better readability
|
Codecov Report
@@ Coverage Diff @@
## master #2750 +/- ##
==========================================
- Coverage 79.20% 79.18% -0.02%
==========================================
Files 333 333
Lines 78561 78614 +53
==========================================
+ Hits 62221 62248 +27
- Misses 14038 14063 +25
- Partials 2302 2303 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Closes #2748
Description
interpreter.StaticType
currently does not expose a mechanism to get the type's ID.interpreter.TypeValue
needs to get a type ID in two places:identifier
fieldHashInput
function, e.g. used when the type value is used as a dictionary keyinterpreter.TypeValue
calculated the type ID by converting the static type to a sema type. This causes the whole program to be loaded, which is inefficient or even unavailable (e.g. during a state migration).Introduce
func StaticType.ID() TypeID
to allow getting the type ID for a static type without overhead, and remove the unnecessary conversions from static to sema type.cc @janezpodhostnik
master
branchFiles changed
in the Github PR explorer