I have a requirement saying a particular class is actually hitting the 'APEX CPU TIME LIMIT'
which i am not aware of nor i haven't worked on it before Need some inputs from you guys like how can i actually refactor the code (i have 1500 lines of code) as in where should i start from do i need to setup some debug logs or any particular way to actually find what is causing the issue.
suggestions are welcome also i am following below SF Links
please suggest,
Thanks in advance #Apex #Apex Trigger #Apex Class #Apex Specialist #Apex Code #Apex, Pages
https://help.salesforce.com/s/articleView?id=000339361&type=1
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm
https://help.salesforce.com/s/articleView?id=000339361&type=1
https://help.salesforce.com/s/articleView?id=000354859&type=1
Apex CPU time limit probably means you have some inefficiencies in the code. Look for nested for loops, unnecessary queries, opportunities for bulkification... This article also has some good suggestions https://welkinsuite.com/blog/how-to-get-past-apex-cpu-limits/