Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn collection of source file information per setup into an opt-in feature #515

Merged
merged 2 commits into from
Nov 6, 2017

Conversation

stakx
Copy link
Contributor

@stakx stakx commented Nov 6, 2017

Up until now, Moq has been collecting source file information for each setup created. This came at a slight performance penalty. There is currently a regression in the .NET Framework which means this penalty becomes gigantic (more expensive than proxy creation!).

This commit turns source file information collection into an opt-in feature. Towards that end, a Switches property is added to Mock and MockRepository which allows users to opt in or out of certain features. Source file info collection is controlled via the switch Switches.CollectDiagnosticFileInfoForSetups.

@stakx stakx force-pushed the hotfix-stacktrace-info branch 2 times, most recently from b4dbc99 to 80c7961 Compare November 6, 2017 17:59
Up until now, Moq has been collecting source file information for each
setups created. This comes at a slight performance penalty. At this
moment, there is a regression in the .NET Framework which means this
penalty becomes gigantic.

This commit turns source file information collection into an opt-in
feature. Towards that end, a `Switches` property is added to `Mock`
and `MockRepository` which allows users to opt in or out of certain
features. Source file info collection is controlled via the switch
`Switches.CollectDiagnosticFileInfoForSetups`.
@stakx stakx merged commit 4fbd597 into devlooped:master Nov 6, 2017
@stakx
Copy link
Contributor Author

stakx commented Nov 6, 2017

Merging this directly, not via PR.

@stakx stakx deleted the hotfix-stacktrace-info branch November 6, 2017 18:14
@stakx stakx mentioned this pull request May 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant