@dambo Thank you for your response. Adding device does not make it faster.
The problem is in if condition. Once I remove it, it loads in about 2-4 seconds. For now, I removed the if, so I’m computing the whole thing even though I sometimes do not need it. But would need to solve this issue if anyone can help.