Explain how you would optimize a piece of C or C++ code that is running on a resource-constrained embedded system.