Click here to Skip to main content
15,505,439 members
Home / Discussions / C#
   

C#

 
AnswerRe: Dictionary<K,V> performance based on Key Type Pin
Matty2221-Aug-14 19:42
Matty2221-Aug-14 19:42 
GeneralRe: Dictionary<K,V> performance based on Key Type Pin
SledgeHammer0121-Aug-14 20:07
SledgeHammer0121-Aug-14 20:07 
GeneralRe: Dictionary<K,V> performance based on Key Type Pin
Matty2221-Aug-14 20:11
Matty2221-Aug-14 20:11 
AnswerRe: Dictionary<K,V> performance based on Key Type Pin
Matty2221-Aug-14 20:18
Matty2221-Aug-14 20:18 
GeneralRe: Dictionary<K,V> performance based on Key Type Pin
SledgeHammer0121-Aug-14 20:53
SledgeHammer0121-Aug-14 20:53 
GeneralRe: Dictionary<K,V> performance based on Key Type Pin
Matty2221-Aug-14 20:58
Matty2221-Aug-14 20:58 
GeneralRe: Dictionary<K,V> performance based on Key Type Pin
Matty2221-Aug-14 21:01
Matty2221-Aug-14 21:01 
GeneralRe: Dictionary<K,V> performance based on Key Type Pin
SledgeHammer0121-Aug-14 21:17
SledgeHammer0121-Aug-14 21:17 
Yes, I was running in debug with the debugger attached. I understand it is a trivial / not full scope test. However, I did the same test on all the various types I mentioned to get a *rough* idea of the differences before I implemented the real thing.

I think seeing that an int was 10ms and a struct was 590ms is pretty indicative the struct is not a good solution (without overriding the IsEquals and GetHashCode methods).

I did try hack in the _Key struct with the overridden IsEquals and GetHashCode methods into my real test application & class that does a lot with the values. I did not use the int key hacky thing I was questioning as that wouldn't work.

My original dictionary<type, someclass=""> took 110ms to run 1M iterations with the debugger attached and 3 items in the dictionary in the real application. Switching it to _Key and properly initializing the struct and the real hash code method bumped it up to 140ms to 150ms. So it actually added 30ms to 40ms of overhead which is what my trivial benchmarks kinda showed it would with 1M iterations.

FYI: Just for fun, I tried commenting out the IsEquals and GetHashCode overrides and it slowed to a crawl @ 1390ms! Wow. That is a lot more then I thought it would.
GeneralRe: Dictionary<K,V> performance based on Key Type Pin
Matty2221-Aug-14 21:45
Matty2221-Aug-14 21:45 
SuggestionRe: Dictionary<K,V> performance based on Key Type Pin
Richard Deeming22-Aug-14 3:25
mveRichard Deeming22-Aug-14 3:25 
AnswerRe: Dictionary<K,V> performance based on Key Type Pin
Rob Philpott22-Aug-14 1:10
Rob Philpott22-Aug-14 1:10 
QuestionNeed help on using sync framework for devices Pin
krishnapnv21-Aug-14 18:05
krishnapnv21-Aug-14 18:05 
AnswerRe: Need help on using sync framework for devices Pin
Eddy Vluggen22-Aug-14 6:12
professionalEddy Vluggen22-Aug-14 6:12 
QuestionDecoding method Pin
jojoba2021-Aug-14 5:36
jojoba2021-Aug-14 5:36 
GeneralRe: Decoding method Pin
Richard MacCutchan21-Aug-14 5:46
mveRichard MacCutchan21-Aug-14 5:46 
GeneralRe: Decoding method Pin
harold aptroot21-Aug-14 5:46
harold aptroot21-Aug-14 5:46 
GeneralRe: Decoding method Pin
PIEBALDconsult21-Aug-14 5:55
professionalPIEBALDconsult21-Aug-14 5:55 
GeneralRe: Decoding method Pin
Bernhard Hiller21-Aug-14 22:43
Bernhard Hiller21-Aug-14 22:43 
GeneralRe: Decoding method Pin
PIEBALDconsult22-Aug-14 4:20
professionalPIEBALDconsult22-Aug-14 4:20 
QuestionRe: Decoding method Pin
jojoba2021-Aug-14 7:42
jojoba2021-Aug-14 7:42 
AnswerRe: Decoding method Pin
OriginalGriff21-Aug-14 9:04
mveOriginalGriff21-Aug-14 9:04 
QuestionRe: Decoding method Pin
jojoba2021-Aug-14 10:45
jojoba2021-Aug-14 10:45 
AnswerRe: Decoding method Pin
Eddy Vluggen21-Aug-14 10:53
professionalEddy Vluggen21-Aug-14 10:53 
AnswerRe: Decoding method Pin
Bernhard Hiller21-Aug-14 22:46
Bernhard Hiller21-Aug-14 22:46 
Questionsplit string into line C# Pin
Member 1054819721-Aug-14 4:05
Member 1054819721-Aug-14 4:05 

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.