Skip to content

Cache static-authorization to sema-access conversion results#4336

Merged
SupunS merged 1 commit intomasterfrom
supun/cache-authorization-conversion
Nov 14, 2025
Merged

Cache static-authorization to sema-access conversion results#4336
SupunS merged 1 commit intomasterfrom
supun/cache-authorization-conversion

Conversation

@SupunS
Copy link
Copy Markdown
Member

@SupunS SupunS commented Nov 13, 2025

Description

Ported from #4327


  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@github-actions
Copy link
Copy Markdown

Benchstat comparison

  • Base branch: onflow:master
  • Base commit: a942168
Results

old.txtnew.txt
time/opdelta
pkg:github.com/onflow/cadence/bbq/compiler goos:linux goarch:amd64
CompileTime-433.0µs ± 0%32.4µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ContractFunctionInvocation-4394µs ± 0%394µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
ContractImport-4192µs ± 0%188µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
Emit-44.15ms ± 0%4.13ms ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ExportType/composite_type-4260ns ± 0%264ns ± 0%~(p=1.000 n=1+1)
ExportType/simple_type-478.1ns ± 0%78.5ns ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
FTTransfer-4115µs ± 0%116µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ImperativeFib-420.9µs ± 0%20.6µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
ImperativeFib-414.5µs ± 0%13.8µs ± 0%~(p=1.000 n=1+1)
ImperativeFibNewCompilerNewVM-434.9µs ± 0%34.2µs ± 0%~(p=1.000 n=1+1)
ImperativeFibNewVM-418.3µs ± 0%16.3µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
InterpretRecursionFib-42.13ms ± 0%2.14ms ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
InterpreterFTTransfer-4113µs ± 0%114µs ± 0%~(p=1.000 n=1+1)
InterpreterImperativeFib-421.1µs ± 0%21.1µs ± 0%~(p=1.000 n=1+1)
InterpreterNewStruct-461.1µs ± 0%60.8µs ± 0%~(p=1.000 n=1+1)
MethodCall/concrete_type_method_call-428.8µs ± 0%29.8µs ± 0%~(p=1.000 n=1+1)
MethodCall/interface_method_call-449.5µs ± 0%50.5µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
NewInterpreter/new_interpreter-41.02µs ± 0%1.10µs ± 0%~(p=1.000 n=1+1)
NewInterpreter/new_sub-interpreter-4318ns ± 0%316ns ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
NewResource-485.8µs ± 0%89.4µs ± 0%~(p=1.000 n=1+1)
NewStruct-433.6µs ± 0%34.6µs ± 0%~(p=1.000 n=1+1)
NewStructRaw-43.51µs ± 0%3.68µs ± 0%~(p=1.000 n=1+1)
RecursionFib-4850µs ± 0%801µs ± 0%~(p=1.000 n=1+1)
RuntimeFungibleTokenTransfer-4726µs ± 0%723µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
RuntimeFungibleTokenTransferInterpreter-4583µs ± 0%587µs ± 0%~(p=1.000 n=1+1)
RuntimeFungibleTokenTransferVM-4618µs ± 0%633µs ± 0%~(p=1.000 n=1+1)
RuntimeResourceDictionaryValues-42.58ms ± 0%2.58ms ± 0%~(p=1.000 n=1+1)
RuntimeResourceTracking-411.6ms ± 0%11.4ms ± 0%~(p=1.000 n=1+1)
RuntimeScriptNoop-414.3µs ± 0%15.1µs ± 0%~(p=1.000 n=1+1)
RuntimeVMInvokeContractImperativeFib-427.5µs ± 0%26.9µs ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ValueIsSubtypeOfSemaType-465.7ns ± 0%69.4ns ± 0%~(p=1.000 n=1+1)
 
alloc/opdelta
pkg:github.com/onflow/cadence/bbq/compiler goos:linux goarch:amd64
CompileTime-416.3kB ± 0%16.3kB ± 0%~(all equal)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ContractFunctionInvocation-4152kB ± 0%152kB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
ContractImport-473.4kB ± 0%73.3kB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
Emit-41.48MB ± 0%1.49MB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ExportType/composite_type-4120B ± 0%120B ± 0%~(all equal)
ExportType/simple_type-40.00B 0.00B ~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
FTTransfer-438.1kB ± 0%38.4kB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ImperativeFib-48.30kB ± 0%8.30kB ± 0%~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
ImperativeFib-41.94kB ± 0%1.94kB ± 0%~(all equal)
ImperativeFibNewCompilerNewVM-421.8kB ± 0%21.8kB ± 0%~(p=1.000 n=1+1)
ImperativeFibNewVM-44.68kB ± 0%4.70kB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
InterpretRecursionFib-41.19MB ± 0%1.19MB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
InterpreterFTTransfer-439.9kB ± 0%39.9kB ± 0%~(p=1.000 n=1+1)
InterpreterImperativeFib-48.29kB ± 0%8.29kB ± 0%~(all equal)
InterpreterNewStruct-424.3kB ± 0%24.3kB ± 0%~(p=1.000 n=1+1)
MethodCall/concrete_type_method_call-47.00kB ± 0%7.00kB ± 0%~(p=1.000 n=1+1)
MethodCall/interface_method_call-414.4kB ± 0%14.5kB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
NewInterpreter/new_interpreter-4976B ± 0%976B ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-4232B ± 0%232B ± 0%~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
NewResource-440.3kB ± 0%40.3kB ± 0%~(p=1.000 n=1+1)
NewStruct-410.4kB ± 0%10.3kB ± 0%~(p=1.000 n=1+1)
NewStructRaw-42.58kB ± 0%2.61kB ± 0%~(p=1.000 n=1+1)
RecursionFib-488.1kB ± 0%88.1kB ± 0%~(all equal)
RuntimeFungibleTokenTransfer-4237kB ± 0%238kB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
RuntimeFungibleTokenTransferInterpreter-4160kB ± 0%159kB ± 0%~(p=1.000 n=1+1)
RuntimeFungibleTokenTransferVM-4173kB ± 0%173kB ± 0%~(p=1.000 n=1+1)
RuntimeResourceDictionaryValues-41.76MB ± 0%1.76MB ± 0%~(p=1.000 n=1+1)
RuntimeResourceTracking-49.26MB ± 0%9.26MB ± 0%~(p=1.000 n=1+1)
RuntimeScriptNoop-48.03kB ± 0%8.03kB ± 0%~(p=1.000 n=1+1)
RuntimeVMInvokeContractImperativeFib-49.79kB ± 0%9.80kB ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ValueIsSubtypeOfSemaType-448.0B ± 0%48.0B ± 0%~(all equal)
 
allocs/opdelta
pkg:github.com/onflow/cadence/bbq/compiler goos:linux goarch:amd64
CompileTime-4176 ± 0%176 ± 0%~(all equal)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ContractFunctionInvocation-42.46k ± 0%2.46k ± 0%~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
ContractImport-4931 ± 0%931 ± 0%~(all equal)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
Emit-439.0k ± 0%39.0k ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
ExportType/composite_type-43.00 ± 0%3.00 ± 0%~(all equal)
ExportType/simple_type-40.00 0.00 ~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
FTTransfer-4966 ± 0%968 ± 0%~(p=1.000 n=1+1)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ImperativeFib-4176 ± 0%176 ± 0%~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
ImperativeFib-449.0 ± 0%49.0 ± 0%~(all equal)
ImperativeFibNewCompilerNewVM-4205 ± 0%205 ± 0%~(all equal)
ImperativeFibNewVM-486.0 ± 0%86.0 ± 0%~(all equal)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
InterpretRecursionFib-417.7k ± 0%17.7k ± 0%~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
InterpreterFTTransfer-4833 ± 0%833 ± 0%~(all equal)
InterpreterImperativeFib-4175 ± 0%175 ± 0%~(all equal)
InterpreterNewStruct-4418 ± 0%418 ± 0%~(all equal)
MethodCall/concrete_type_method_call-4135 ± 0%135 ± 0%~(all equal)
MethodCall/interface_method_call-4285 ± 0%285 ± 0%~(all equal)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
NewInterpreter/new_interpreter-415.0 ± 0%15.0 ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-44.00 ± 0%4.00 ± 0%~(all equal)
pkg:github.com/onflow/cadence/bbq/vm/test goos:linux goarch:amd64
NewResource-4722 ± 0%722 ± 0%~(all equal)
NewStruct-4219 ± 0%219 ± 0%~(all equal)
NewStructRaw-438.0 ± 0%38.0 ± 0%~(all equal)
RecursionFib-43.65k ± 0%3.65k ± 0%~(all equal)
RuntimeFungibleTokenTransfer-43.98k ± 0%3.98k ± 0%~(all equal)
pkg:github.com/onflow/cadence/runtime goos:linux goarch:amd64
RuntimeFungibleTokenTransferInterpreter-42.98k ± 0%2.98k ± 0%~(all equal)
RuntimeFungibleTokenTransferVM-43.00k ± 0%3.00k ± 0%~(p=1.000 n=1+1)
RuntimeResourceDictionaryValues-436.7k ± 0%36.7k ± 0%~(all equal)
RuntimeResourceTracking-4159k ± 0%159k ± 0%~(all equal)
RuntimeScriptNoop-4113 ± 0%113 ± 0%~(all equal)
RuntimeVMInvokeContractImperativeFib-4197 ± 0%197 ± 0%~(all equal)
pkg:github.com/onflow/cadence/interpreter goos:linux goarch:amd64
ValueIsSubtypeOfSemaType-41.00 ± 0%1.00 ± 0%~(all equal)
 

Copy link
Copy Markdown
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thank you

@SupunS SupunS merged commit 589f827 into master Nov 14, 2025
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants