Add [SuppressGCTransition] to GetSysColor (#37284)
authorJeremy Kuhne <jkuhne@microsoft.com>
Wed, 3 Jun 2020 02:46:19 +0000 (19:46 -0700)
committerGitHub <noreply@github.com>
Wed, 3 Jun 2020 02:46:19 +0000 (22:46 -0400)
commit5b284d71233822cf2bb1893ce72cb52ea561b86b
tree6a7f0f56fb9a94b7742eec6747cca9f122312a67
parenta5a91d3871d74bdc2092ebe7972513a098bb1312
Add [SuppressGCTransition] to GetSysColor (#37284)

The API is just a bounds check array dereference. Adding the new attribute cuts the time getting the color in half. As this value isn't cached, this can add up with multiple calls to a `Color` that is based on a system color (on Windows).
src/libraries/Common/src/Interop/Windows/User32/Interop.GetSysColor.cs