Both JVM and V8 perform optimizations and deoptimizations on the code they produce, but optimizations usually require the VM to profile the code while it's running.
Now, If my app is running on a server, that won't be a problem since the code is always running, but if I were to use serverless, the functions would run in a sporadic manner (in an event-driven manner only when they are needed), which won't allow the VM to profile or optimize my functions.
So, Does this mean that running serverless would be inherently slower because it lacks optimizations, or does FaaS work in a different way to allow the optimization of my code?