http://msdn.microsoft.com/en-us/library/system.object.gethashcode(VS.80).aspx says:
For best performance, the hash function should generate a random distribution for all input.
Does this have any performance impact or is it okay to use a function (like return this.Id) that doesn't give a "random distribution" but doesn't cause more conflicts?
this.Id . , , . , - "mod x", x - -, ( ).
(1, 2, 3, 4...), . , , , .
return this.Id ( Id ) - , . - Id 27 , ?
return this.Id
Id
, GetHashCode Equals .
GetHashCode
Equals
, ... , , - " " int ( .net, , , ), .
int
: , - 1 10. - , 100, 10 . , , .
, . hashtables, ( ). , , , , -, hash_code%buckets .
hash_code%buckets
this.Id.GetHashCode();
, , , Id.
Source: https://habr.com/ru/post/1702759/More articles:In C #, is there a ready-made way to create a three-way lookup table? - c #Eclipse PDE - marker annotation type - background color is not updated - eclipseHow to see the latest relationship changes in a SQL 2000 database - sql-serverTabbed Interface in C # / WPF - c #What do you think of Castle ActiveRecord? - activerecordHow do you perform validation in ASP.NET MVC RC? - validationShould I clone or denormalize my database for portable use? - databaseFirefox extension: Insert javascript into a web page - firefox-addonIs there any way to find out how much RAM is used in a session? - asp.netЛучшая практика для работы служб отчетов SQL Server. Должен ли я запускать базу данных или веб-сервер? - sql-serverAll Articles