[Compiler] Re-use static to sema conversions in vm.#4287
[Compiler] Re-use static to sema conversions in vm.#4287
Conversation
Benchstat comparison
Results
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
84d40f6 to
d6167e7
Compare
22c2edb to
7bc4611
Compare
3c317a6 to
b7fad6b
Compare
There was a problem hiding this comment.
It's surprising how/why caching doesn't improve the performance, given that first iteration of caching in #4054 gave us some improvement.
Given that we already cache it after the very first conversion, maybe that initial conversion overhead is trivial?
Could you please add some more stat: for example, the number of cache hits/misses before and after the improvement?
Additionally, do we also need to cache types coming from the imports / for the imported programs?
bbq/program.go
Outdated
| Variables []Variable[E] | ||
| Types []T | ||
| Globals []Global | ||
| SemaTypeCache map[sema.TypeID]sema.Type |
There was a problem hiding this comment.
bbq.Program is currently serializable (and deserializable), even though we don't make use of it at the moment. But, we would lose this capability if we include sema.Type information in bbq.Program.
Could we instead pass this mapping externally? i.e: maybe as part of the vm.Config?
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
For FTTransfer, cache hits/miss before: vs cache hits/miss after: I would guess the initial conversion overhead is insignificant as you said. Benchmarking FTTransfer reveals no real improvement.
Ideally yes, since for FTTransfer the same compiler config is used for all contracts, all the imported types should be cached in the stats above. |
Work towards #4273
Description
Re-use static to sema conversions from the compiler in the vm. Tried various changes in the linker to no success, tried caching static type ID calls, which was an improvement but affects execution, so not included.
masterbranchFiles changedin the Github PR explorer