forked from SharpRepository/SharpRepository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Performance gain on primary key lookup
Added a static dictionary that "caches" the PK lookup after the first time. This way it doesn't have to use reflection to get the PK property of the entity after the first time. It is 3 times as fast getting it from the dictionary than using the Reflection based on my simple testing.
- Loading branch information
Jeff Treuting
committed
Jul 9, 2013
1 parent
7da3069
commit 5c063d6
Showing
3 changed files
with
25 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Reflection; | ||
|
||
namespace SharpRepository.Repository.Helpers | ||
{ | ||
internal static class InternalCache | ||
{ | ||
internal static readonly IDictionary<Tuple<Type, Type>, PropertyInfo> PrimaryKeyMapping = new Dictionary<Tuple<Type, Type>, PropertyInfo>(); | ||
} | ||
} |
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