Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Merge changes from TFS - #1686

Merged
jkotas merged 1 commit into
dotnet:nmirrorfrom
dotnet-bot:from-tfs
Aug 22, 2016
Merged

jkotas merged 1 commit into
dotnet:nmirrorfrom
dotnet-bot:from-tfs

Conversation

@dotnet-bot

Copy link
Copy Markdown
Collaborator

No description provided.

CR: JKotas, SergeyK, MorganB, DavidWr

Introduce a SyncTable for faster mapping from objects to associated Monitor synchronization (Lock) objects.  This implementation is faster than ConditionalWeakTable, which we have been using so far, for two reasons:

1)  We store the synchronization entry index in the object header, which avoids a hash table lookup.
2)  We store a strong reference to the synchronization object, which allows retrieving it much faster than going through a DependentHandle.

The design is described at the top of SyncTable.cs file.  Should we hit any issues, the new code may be disabled by setting the UseSyncTable property to false in System.Private.CoreLib.csproj.

I also commented out unused debugger support code, which is unfinished and may affect performance.

The lock performance improvement is 2.6 times for multi-file builds and 2.4 times for single-file builds as measured on x86.

[tfs-changeset: 1623451]
@jkotas
jkotas merged commit 24535fd into dotnet:nmirror Aug 22, 2016
@dotnet-bot
dotnet-bot deleted the from-tfs branch August 22, 2016 02:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants