diff options
author | Scott Mosier <smosier@microsoft.com> | 2016-04-29 21:04:50 +0300 |
---|---|---|
committer | Scott Mosier <smosier@microsoft.com> | 2016-04-29 21:04:50 +0300 |
commit | ede47337e4736cda31f963e1dacaf38f1d09e2f5 (patch) | |
tree | f11e071c1264c85b8a4f5d8382eb3eabaf8f95f8 /src/Native/Runtime/startup.cpp | |
parent | e71eafae093ab4434e195dada959ac840d968bfc (diff) |
Implement type casting cache
This checkin is an adaptation of a cache used in the type loader. It is applied to our type casting APIs and brings a significant performance improvement to any type-cast-heavy workload.
The cache has an initial tuning that looks reasonable, but should still be considered provisional as we gather more data on its behavior across various workloads.
[tfs-changeset: 1600411]
Diffstat (limited to 'src/Native/Runtime/startup.cpp')
-rw-r--r-- | src/Native/Runtime/startup.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Native/Runtime/startup.cpp b/src/Native/Runtime/startup.cpp index ce6298cff..68aeb7f2d 100644 --- a/src/Native/Runtime/startup.cpp +++ b/src/Native/Runtime/startup.cpp @@ -43,6 +43,8 @@ extern RhConfig * g_pRhConfig; EXTERN_C bool g_fHasFastFxsave = false; +CrstStatic g_CastCacheLock; + bool InitDLL(HANDLE hPalInstance) { CheckForPalFallback(); @@ -101,6 +103,9 @@ bool InitDLL(HANDLE hPalInstance) DetectCPUFeatures(); + if (!g_CastCacheLock.InitNoThrow(CrstType::CrstCastCache)) + return false; + return true; } |