Srini-komman / dapper-dot-net

Automatically exported from code.google.com/p/dapper-dot-net
Other
0 stars 0 forks source link

do not use Type information as part for Dictionary key #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
public static SomeType<T>
{
    public static readonly Object SomeObj = new Object();
}

ReferenceEquals(SomeType<int>.SomeObj, SomeType<int>.SomeObj) => true
ReferenceEquals(SomeType<int>.SomeObj, SomeType<long>.SomeObj) => false

So move targetType/parameterType/otherTypes outside Identity for even faster 
processing:

private static class QueryCacheHolder<TTarget, TParam,TFirst,...TLast>
{
private statict readonly Dictionary<Identity, CacheInfo> = ...
}

Original issue reported on code.google.com by dimzon...@gmail.com on 24 May 2011 at 2:42

GoogleCodeExporter commented 8 years ago
I follow, have you benchmarked to see what kind of a diff this makes? 

Original comment by sam.saff...@gmail.com on 1 Jun 2011 at 9:33

GoogleCodeExporter commented 8 years ago
I am rejecting this, if any benchmarks prove this will improve perf I will be 
happy to revisit.

Original comment by sam.saff...@gmail.com on 13 Jul 2011 at 7:04