There are many things to consider starting with what version of Ax and SQL and what hardware - the right hardware eg correct RAID, spindles, Power setting, location of logs and operating system on separate drives from application, not running automatic office updates on the production server, not anti virus checking Ax, Windows Server patching, use of flash drives for operating system etc. Whether load balanced AOS are set up.
Then the database RCSI , traceflags, temporary database set up, management of database growth, sql maintenance plans - sql statistics is generally much more important than indexing in Ax. Back up method.
Management of windows and sql logs.
Are unnecessary modules configured.?
Workflow timeout settings, not having test systems in productjon,. Remove unwanted localisation indexes on major tables,
Where do users experience problems? What is the volume of transactions? Number of users/ DO run retail -how many pos? Are the settings optimum for the number or pos
There are many configurations and pieces of code that perform differently under different configurations, filters or data volumes. Are inventory closes and month end up to date. Do you run mrp?
Do you have adds on, multiple reports, or customisations, or integrations or localisation requirements or multi company processes?
An enterprise system like this Is rather too big a subject for self help, unless its just one specific issue you are facing, An experienced partner should be able to help you to check probable known issues, or those that factors that should be considered when coding for your environment with a 2-3 day audit. Much of which can probably be done remotely. .
Your intention to avoid coding errors is commendable but I agree, you need to measure also -test systems do not perform the same as production systems..