Hosting on serveless environments
Hi, taking into consideration the fact that impromptu-interface uses reflection.emit to generate the proxies, I suppose using this technique on a serverless/microservices environment where services are spawned upon request would not be suggested, as the proxies must be regenerated every time a new instance of the service is started.
So do you indeed discourage the use on such environments ? Is there any way to cache the proxies between different instances ?
If you are measuring it and find it too slow than I suggest you don't use it. The types it emits are pretty lightweight, so shouldn't slow things down too much. There used to be a way to pre-save the emitted DLLs but that disappeared for .net standard.
The proxies it implements are essentially in C#:
public class Test:ITestInterface {
dynamic target;
public int Prop1 => target.Prop1
public void Method1() => target.Method1();
//etc
So you could always implement your own and see if you get a speed bump.