stryker-mutator / stryker-net

Mutation testing for .NET core and .NET framework!
https://stryker-mutator.io
Apache License 2.0
1.76k stars 175 forks source link

[SPIKE] Investigate the cost of resolving semantic models for all syntax trees. #2720

Closed richardwerkman closed 10 months ago

richardwerkman commented 11 months ago

Is your feature request related to a problem? Please describe. So far we have denied the need for semantic models as we assumed the cost of resolving the semantic models outweighs the value. However we are not sure what the exact cost is for the resolution.

Describe the solution you'd like I'd like to investigate what the exact cost is for resolving the semantic models on a big solution. If the cost is low (a few milliseconds) we can implement this and use the semantic models in our mutators. This would greatly improve our capabilities as we are now often blocked by the unknown types in a mutator.

A good starting point could be the visual studio performance profiler or some other tool to record performance.

richardwerkman commented 11 months ago

I did some initial testing and it seems the cost is very low. I resolved all the semantic models on the stryker solution (275 files) and this took 7 milliseconds. So I want to investigate this further. However, we need to rework the initialisation of Stryker a bit to make this work. We need a compilation object to query the semantic models. But we create the compilation object after creating the mutations. We'd have to create a second compilation object before creating the mutations to make this work. I'll investigate further.