Hi ajitha,
following best practice to optimizing your code
https://docs.mendix.com/howto/monitoring-troubleshooting/detect-and-resolve-performance-issues#optimizing
and you can also check the microflows loading time where it take time to load
https://docs.mendix.com/howto/monitoring-troubleshooting/detect-and-resolve-performance-issues#4-3-microflow-time-stamps
Hello Ajitha,
Please take a look at https://docs.mendix.com/refguide/aggregate-list and https://docs.mendix.com/howto/logic-business-rules/optimizing-microflow-aggregates to see if this can be a solution to your use case.