seesharper / ProxyBenchmarks

.Net dynamic proxy benchmarks
5 stars 0 forks source link

Please report initialization and first call time #2

Open dzmitry-lahoda opened 5 years ago

dzmitry-lahoda commented 5 years ago

Problem with proxies is that these slow down start up. So the value of start is sometimes important People may avoid proxies because of that and generate these using Roslyn to parses and generate during compilation.

seesharper commented 5 years ago

PR's are welcome 😄

dzmitry-lahoda commented 5 years ago

Not sure how to do start up time measurements via BenchmarkDotNet. But this topic is essential. I have met objection-issues about proxies on each project regarding start up time. And found these in the wild from time to time. It is of same importance as DI/IOC overhead on start https://github.com/dadhi/DryIoc/issues/27.

seesharper commented 5 years ago

There is always going to be a first time hit with libraries that generate code at runtime. IoC container, ORM's, mappers and so on. The best way to deal with this specially in the context of a web application, is to perform some kind of warmup hitting the endpoints

dzmitry-lahoda commented 5 years ago

https://twitter.com/DanJSiegel/status/1039569379698991106

Elastic services, Microsoft Office plugins, mobile games. All need fast start up time without previous warm up. And it is possible to optimize or consider pros and cons of using runtime proxies or using compile time Roslyn generation.