What causes poor optimization/ frame rate?

From what I know already having models with excessive poly counts will overtax your machine and lead to a drop in frame rate, but I’ve seen in many games the detail on models is low yet the frame rate can’t even reach 60. I’m looking for a checklist of everything that could drag performance down. Do things like useless while loops or poorly organized code, as in a large function written out in 6 lines that could be easily be simplified to only take 3, have any effect on the frame rate? Poor performance is one of my biggest gaming pet peeves so I want to know how to prevent it.

In UE4 it’s mostly graphical features. Probably the biggest issue with UE4 is finding all of the things that can impact performance and adjusting them–not all of the settings are exposed in the editor, some are only in the ini files so it can be a struggle.

Drawcalls is the main problem.