impromptu-interface icon indicating copy to clipboard operation
impromptu-interface copied to clipboard

lock and Dictionary

Open rioka opened this issue 6 years ago • 3 comments

Not an issue, I was just looking at the code and wondering... is there any specific reason to prefer lock+standard Dictionary over ConcurrentDictionary for _typeHash and _delegateCache in BuildProxy?

rioka avatar Mar 26 '19 15:03 rioka

It's been so long, I'm not sure. Might have been performance tuned, or maybe not. There are tradeoffs and benefits performance wise for to ConcurrentDictionary. But honestly, it could be that it could benefit from a ConcurrentDictionary without manual locks, the choice for the dictionary was 9 years ago in the initial commit, makes me think it was something that was just overlooked.

jbtule avatar Mar 26 '19 15:03 jbtule

That line was written a month after .net 4.0 was released, I pretty sure it was just overlooked.

jbtule avatar Mar 26 '19 16:03 jbtule

👍

rioka avatar May 28 '19 08:05 rioka