Click here to Skip to main content
15,881,089 members
Home / Discussions / C#
   

C#

 
AnswerRe: Create & Download file runtime in MVC Pin
Nathan Minier22-Aug-14 4:42
professionalNathan Minier22-Aug-14 4:42 
QuestionVS2010 crashes When Designer View Opens Pin
AmbiguousName21-Aug-14 20:43
AmbiguousName21-Aug-14 20:43 
AnswerRe: VS2010 crashes When Designer View Opens Pin
Bernhard Hiller21-Aug-14 21:27
Bernhard Hiller21-Aug-14 21:27 
GeneralRe: VS2010 crashes When Designer View Opens Pin
AmbiguousName21-Aug-14 22:24
AmbiguousName21-Aug-14 22:24 
GeneralRe: VS2010 crashes When Designer View Opens Pin
Rob Philpott22-Aug-14 0:05
Rob Philpott22-Aug-14 0:05 
QuestionDictionary<K,V> performance based on Key Type Pin
SledgeHammer0121-Aug-14 18:29
SledgeHammer0121-Aug-14 18:29 
AnswerRe: Dictionary<K,V> performance based on Key Type Pin
Matty2221-Aug-14 18:42
Matty2221-Aug-14 18:42 
GeneralRe: Dictionary<K,V> performance based on Key Type Pin
SledgeHammer0121-Aug-14 19:07
SledgeHammer0121-Aug-14 19:07 
I tried something like this:

C#
class _Key
	{
		public string s;
		public Type t;

		public override int GetHashCode()
		{
			return s.GetHashCode() ^ t.GetHashCode();
		}

		public override bool Equals(object obj)
		{
			_Key o = obj as _Key;

			if (o == null)
				return false;

			if (s == o.s && t == o.t)
				return true;

			return false;
		}
	}


and it yielded 60ms. Seems kinda pricey still. Compared to the Type key alone (20ms).

EDIT: tried something else... made the key an int and called GetHashCode() on the object to get the key. That knocked it down to 40ms.

EDIT #2: tried just returning the GetHashCode() on one of the members. Type = 50ms, string = 50ms.

Not really sure of a better way to implement GetHashCode().

Any suggestions?
GeneralRe: Dictionary<K,V> performance based on Key Type Pin
Matty2221-Aug-14 19:11
Matty2221-Aug-14 19:11 
AnswerRe: Dictionary<K,V> performance based on Key Type Pin
Matty2221-Aug-14 19:18
Matty2221-Aug-14 19:18 
GeneralRe: Dictionary<K,V> performance based on Key Type Pin
SledgeHammer0121-Aug-14 19:53
SledgeHammer0121-Aug-14 19:53 
GeneralRe: Dictionary<K,V> performance based on Key Type Pin
Matty2221-Aug-14 19:58
Matty2221-Aug-14 19:58 
GeneralRe: Dictionary<K,V> performance based on Key Type Pin
Matty2221-Aug-14 20:01
Matty2221-Aug-14 20:01 
GeneralRe: Dictionary<K,V> performance based on Key Type Pin
SledgeHammer0121-Aug-14 20:17
SledgeHammer0121-Aug-14 20:17 
GeneralRe: Dictionary<K,V> performance based on Key Type Pin
Matty2221-Aug-14 20:45
Matty2221-Aug-14 20:45 
SuggestionRe: Dictionary<K,V> performance based on Key Type Pin
Richard Deeming22-Aug-14 2:25
mveRichard Deeming22-Aug-14 2:25 
AnswerRe: Dictionary<K,V> performance based on Key Type Pin
Rob Philpott22-Aug-14 0:10
Rob Philpott22-Aug-14 0:10 
QuestionNeed help on using sync framework for devices Pin
krishnapnv21-Aug-14 17:05
krishnapnv21-Aug-14 17:05 
AnswerRe: Need help on using sync framework for devices Pin
Eddy Vluggen22-Aug-14 5:12
professionalEddy Vluggen22-Aug-14 5:12 
QuestionDecoding method Pin
jojoba2021-Aug-14 4:36
jojoba2021-Aug-14 4:36 
GeneralRe: Decoding method Pin
Richard MacCutchan21-Aug-14 4:46
mveRichard MacCutchan21-Aug-14 4:46 
GeneralRe: Decoding method Pin
harold aptroot21-Aug-14 4:46
harold aptroot21-Aug-14 4:46 
GeneralRe: Decoding method Pin
PIEBALDconsult21-Aug-14 4:55
mvePIEBALDconsult21-Aug-14 4:55 
GeneralRe: Decoding method Pin
Bernhard Hiller21-Aug-14 21:43
Bernhard Hiller21-Aug-14 21:43 
GeneralRe: Decoding method Pin
PIEBALDconsult22-Aug-14 3:20
mvePIEBALDconsult22-Aug-14 3:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.