Download "XP Performance Monitor." It shows you which specific line of code in which specific Lua script is taking 40ms to process. Kill that script.
Here's an example configuration for a mid-range system: fps boost x plane 11 new
X-Plane relies heavily on single-core CPU performance to calculate flight physics and draw calls. Download "XP Performance Monitor