Is there an approach to do parameters update that does not require re-compile but still has the benefits of optimizations similar to regard the parameters as constants?

My question is about whether there is some better way to deal with parameters update for online serving. As I know, there are two ways to do parameters update now:

  1. Re-compile the model with new parameters and create a new graph executor for the serving. In this way, we can bind the parameters as constants during the compile process, and some optimization like constant folding can be done. But the problem is the re-compile process is time and resource consuming, and is not friendly for the online serving.

  2. Treat parameters as general inputs. Feed the graph executor with new parameters via SetInput interface. This approach requires not binding parameters during the compile process. Therefore, the optimizations like constant folding cannot be used, which may degrade the overall performance.

So my question is whether there is an approach(or a plan for it) to do parameters update that does not require re-compile but still has the benefits of optimizations similar to regard the parameters as constants?