If you’re higher up the stack, sure. If you want performance, you want to keep the dev/prod environment alike so that you can properly optimize
I was speaking to whether the code will work. The answer is almost always yes. Optimizations at a higher level such as algorithm choice or where allocations are performed also are architecture neutral. This is most optimization.