Unusual Performance behaviour of local variables

Certified Lead Developer

Hi,

I observed an unusual behaviour with the performance of local variables used within a!localVariables(). I have a variable local!a and the value to it is mapped from a query entitiy data. I have a second variable local!b and value to it is mapped as local!a (local!b : local!a). And here comes the third variable local!c which has mapped with a query entity data as it's value.

The issue here is the variable local!b takes the same load time as local!a though I am just mapping local!a to local!b (local!b : local!a) and does not have any other operations mapped to local!b. The point to be noted here is when I remove the third variable local!c which is mapped with a query entity as well, then I don't see the local!b takes the same load time as local!a. From this I am understanding that when an interface have more than one query entity then we see this kind of performance behaviour with local variable mapping (local!b : local!a). I may be wrong here with my understanding and if any of you aware of this behaviour, what is the solution recommended please?

Below is the example snippet:

a!localVariables(
local!a: a!refreshVariable(
value: a!queryEntity(
entity: cons!ABC_ENTITY,
query: a!query(
pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: - 1
)
)
).data,
refreshOnReferencedVarChange: false()
),
local!b: a!refreshVariable(
value: local!a,
refreshOnReferencedVarChange: false()
),
local!c: a!refreshVariable(
value: a!queryEntity(
entity: cons!XYZ_ENTITY,
query: a!query(
pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: - 1
)
)
).data,
refreshOnReferencedVarChange: false()
),
a!textField(
label: "TEST"
)
)

Thanks

  Discussion posts and replies are publicly visible