That question is quite the rabbit hole, as stated in another answer don't just make an engine. That's your first mistake you're generalizing something that is inherently specific, performance is all about specifics you have to write code tailored to a specific platform to run a specific type of game.
These optimizing tend to go as low level as possible, writing custom memory allocators, optimizing cache use, making good use of parallelism, having good algorithms, etc. and like I said a lot of these topics are a big rabbit hole full of "black magic", that will take months to learn much less master.
Unless you have a concrete game idea and a platform you will dedicate yourself to for a while, just don't bother you'll be better of with good enough performance and more time on the actual important thing, a good game. Besides hardware is always getting faster so speed won't be an issue for long anyway.