Strange Local Variable Performance

Certified Associate Developer

I have been working on improving the performance of my interface, and I came across some performance results that I don't understand. I have a local variable (local!initialData) that calls an expression rule. I have a second local variable (local!dataCapture) that is just a copy of local!initialData. Looking in the performance tab of the interface, both of these local variables take the exact same amount of time to evaluate (+/- 1ms). However, I would expect local!initialData to take longer than local!dataCapture since local!dataCapture is just copying the data from local!initialData, not running the expression rule.

Can anyone explain this to me? Is this to be expected, or am I doing something wrong to cause this to happen?

I have attached an image of the performance numbers for these two local variables and have included the definitions of both below.

Thanks in advance!

local!initialData: a!forEach(
    local!orderLineData,
    rule!SSTH_initialData(
      orderLineData: local!orderLineData,
      index: fv!index,
      desiredOutput: "dataCapture"
    )
),
local!dataCapture: local!initialData,

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    I see a few other things I would do different, but there is nothing wrong with that code snippet.

    It could be that the second local wants to evaluate, but has to wait for the first one to complete. This would explain the one millisecond difference. But this is more guesswork than deep knowledge.

  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    That could make sense, as local!dataCapture always seems to be 1-3% higher than local!initialData, even if the time is the same. I tried moving local!dataCapture down in the code a little, just to see what would happen (there is now another call to that rule in between local!initialData and local!dataCapture), and local!initialData is now taking a few ms longer than local!dataCapture. This seems like a good indication that your guess is correct, as the rule now has a few more ms to evaluate before local!dataCapture tries to evaluate.

    I also tried copying the expression from local!initialData into local!dataCapture (so it evaluates the same rule twice). This seems to have uncoupled the two variables, further indicating that your guess may be correct.

    Out of curiosity, what do you see that you would do differently? I'm always open to suggestions (especially ones to improve performance as 1,000+ ms is definitely not ideal)

Reply
  • 0
    Certified Associate Developer
    in reply to Stefan Helzle

    That could make sense, as local!dataCapture always seems to be 1-3% higher than local!initialData, even if the time is the same. I tried moving local!dataCapture down in the code a little, just to see what would happen (there is now another call to that rule in between local!initialData and local!dataCapture), and local!initialData is now taking a few ms longer than local!dataCapture. This seems like a good indication that your guess is correct, as the rule now has a few more ms to evaluate before local!dataCapture tries to evaluate.

    I also tried copying the expression from local!initialData into local!dataCapture (so it evaluates the same rule twice). This seems to have uncoupled the two variables, further indicating that your guess may be correct.

    Out of curiosity, what do you see that you would do differently? I'm always open to suggestions (especially ones to improve performance as 1,000+ ms is definitely not ideal)

Children