-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor initialization logic to allow for enabling Memory Randomizat…
…ion (#1587) * there is no need for the warmup workaround anymore, dotnet/BenchmarkDotNet#1573 has solved the problem * allocate the array first to try to take advantage of memory randomization as it's usually the first thing called from GlobalSetup method which with MemoryRandomization enabled is the first method called right after allocation of random-sized memory by BDN engine * avoid having big global setup methods and try to have Targeted setups that allocate less as Global Setup methods might get called right after random-size memory allocation * avoid readonly fields, initialize them in [GlobalSetup] instead of ctors (to allow for re-allocation with different alignment) * this code can be executed only once * make sure that every setup creates a brand new delegate instead of combining with existing one * the "WriteDeepUtf16" benchmark can report up to x4 more time when MemoryRandmization is enabled this is due to having new _arrayBufferWriter every time and allocating a lot of memory so we don't always allocate a new instance * allocate the array in GlobalSetup, not in field initializer
- Loading branch information
1 parent
ed8fbe6
commit e8a8fc6
Showing
53 changed files
with
632 additions
and
486 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.