Executing code from RAM is significantly faster than executing it from flash memory. Most CPUs are heavily optimized for the fastest possible RAM access, and even the fastest flash memory only reaches a fraction of the speed of RAM.
However keep in mind that moving the code from flash to RAM also takes time. If code is executed only once, you only need to read it once, and therefore you would actually loose time for copying it into RAM first instead of executing it directly. If code is executed occasionally (so copying it into RAM would increase execution the second time it is called), but the system is generally idle, then you would execute that code faster by copying it into RAM, but no one cares, because the system has enough time to spent.
So such optimizations are only worth the effort, if the code is executed frequently, and you have measured it to be a choking point of the system.
On the other hand RAM needs to actively keep the data stored, while flash memory does not, so the total power consumption increases, if RAM needs to be kept active. This is however only relevant, if the RAM is otherwise not used at all, but most modern systems will - in one way or another - use the available RAM already and therefore already keep it active.