microsoft / Power-Fx

Power Fx low-code programming language
MIT License
3.21k stars 329 forks source link

Change Lookup order in BinderUtils.TryGetConstantValue to check entitystore first #2703

Closed lesaltzm closed 1 month ago

lesaltzm commented 1 month ago

NameResolver.Lookup is a weirdly expensive operation when done from the middle of a running analysis pass. A few functions call TryGetConstantValue from CheckTypes, which is called during analysis to get functions result types. In JSON it was possible to move that to CheckSemantics, but in Match, we want to avoid the expensive call to Lookup if we can, so we first look in the EntityStore to resolve enums.

This doesn't meaningfully change the scenario for non PA hosts, as the entity store is a PA-only concept.

LucGenetier commented 1 month ago

✅ No public API change.

LucGenetier commented 1 month ago

✅ No public API change.