mathnet-numerics icon indicating copy to clipboard operation
mathnet-numerics copied to clipboard

Verify TargetedPatchingOptOut has no effect and drop all of them if confirmed

Open cdrnet opened this issue 11 years ago • 1 comments

We currently apply TargetedPatchingOptOut attributes in a few places to mark functions that should be inlined. However, it seems this does not actually have any effect since user assemblies (i.e. those not part of the BCL) do not opt into targeted patching (inplace framework upgrades) in the first place and are thus automatically inlined where appropriate.

  • [ ] Confirm that they indeed have no effect, and drop usages if true.
  • [ ] Consider to use MethodImplOptions.AggressiveInlining instead in these places - although beware that this is only available in .Net 4.5, while the code base must compile also in portable profiles, .Net 3.5 etc.

cdrnet avatar Jan 15 '14 22:01 cdrnet

See also:

  • http://blogs.microsoft.co.il/sasha/2012/01/20/aggressive-inlining-in-the-clr-45-jit/
  • http://stackoverflow.com/questions/14937647/method-inlining-across-native-images-of-assemblies#14982340
  • http://stackoverflow.com/questions/6109745/targetedpatchingoptout-performance-critical-to-inline-across-ngen-image-bounda

cdrnet avatar Jan 15 '14 22:01 cdrnet