{"id":329758,"date":"2022-02-17T15:01:56","date_gmt":"2022-02-17T15:01:56","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=329758"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=329758","title":{"rendered":"<span>.Net Dictionary \u0438 \u043a\u0430\u043a \u043e\u043d\u0438 \u043e\u0431\u0438\u0442\u0430\u044e\u0442<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0416\u0435\u043d\u044f, \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432 Itransition \u043a\u0430\u043a backend .Net developer \u2013 \u0438 \u044d\u0442\u043e \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0442\u0435\u043c\u0443. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0442\u0438\u043f\u0430\u0445 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u0432\u0430\u044e\u0442 \u0432 .Net, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e Hash table, \u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438, \u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445, \u0438 \u0434\u0430\u0436\u0435 \u0441\u043b\u0435\u0433\u043a\u0430 \u043e Tree.<\/p>\n<h2>Big O<\/h2>\n<p>\u0414\u043b\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0445\u043e\u0442\u044f-\u0431\u044b \u0432\u0441\u043a\u043e\u043b\u044c\u0437\u044c \u043f\u0440\u043e\u0431\u0435\u0436\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438. \u0417\u0432\u0443\u0447\u0438\u0442 \u0437\u0430\u0443\u043c\u043d\u043e, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. \u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0438 \u0432\u044b\u0434\u0432\u0438\u0433\u0430\u0442\u044c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u043f\u043e\u0447\u0435\u043c\u0443 O(1) \u043b\u0443\u0447\u0448\u0435 O(n), \u043d\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e O(1) \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442. \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0434\u0432\u0443\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c \u2013 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438 \u043f\u043e \u0437\u0430\u0442\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438 \u0432\u0440\u0435\u043c\u044f, \u0438 \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0435 \u0431\u0435\u0437\u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b, \u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0445 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0443\u0442\u0438 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f. \u041d\u0430\u043c \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e 3 \u0438\u0437 \u043d\u0438\u0445:<\/p>\n<p><strong>O(1)<\/strong> \u2013 \u0441\u0430\u043c\u044b\u0439 \u0436\u0435\u043b\u0430\u043d\u043d\u044b\u0439, \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0438 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0432 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438. \u041e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0440\u0438 \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e \u0440\u0430\u0441\u0442\u0443\u0449\u0435\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u0443\u044e \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u044d\u0442\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u0441\u0435\u043a\u0443\u043d\u0434\u0430 \u0438 \u0434\u0435\u043d\u044c, \u043d\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u044d\u0442\u043e \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u044b\u0442\u044b\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c.<\/p>\n<p><strong>O(n) \u2013 <\/strong>\u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0445\u0443\u0436\u0435 O(1), \u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u044b\u0439, \u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439. \u041e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0441\u0442\u0435\u0442 \u043b\u0438\u043d\u0435\u0439\u043d\u043e \u0441 \u0440\u043e\u0441\u0442\u043e\u043c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0443\u0436\u0438\u0442\u044c \u0410\u0417\u0421 \u2013 \u0432 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043a\u043e\u043b\u043e\u043d\u043a\u0430 \u043a\u0430\u0447\u0430\u0435\u0442 1 \u043b. \u0442\u043e\u043f\u043b\u0438\u0432\u0430: \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043a\u0430\u0447\u0430\u0442\u044c 100 \u043b\u0438\u0442\u0440\u043e\u0432, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432 100 \u0440\u0430\u0437 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0441 \u0442\u043e\u0439 \u0436\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p><strong>O(logN) \u2013 <\/strong>\u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u0445\u0443\u0436\u0435 O(1), \u043d\u043e \u043b\u0443\u0447\u0448\u0435 O(n). \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e. \u041d\u043e \u0435\u0441\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u043d\u043e, \u0442\u043e \u0441\u043c\u044b\u0441\u043b \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0434\u0430\u0435\u0442 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u0432 2 \u0440\u0430\u0437\u0430, \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c (\u043a \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u043c \u043c\u044b \u0435\u0449\u0435 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435), \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0444\u0438\u0442 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0435\u043c\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h2>Hashtable<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437 \u043e HashTable \u2013 \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0441\u0435\u0439\u0447\u0430\u0441 (.net6) \u0438 \u043a\u0430\u043a \u043b\u044e\u0431\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c:<\/p>\n<p><code>var hashTable = new Hashtable();<\/code><\/p>\n<p>\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u0430\u0436\u0435 \u0447\u0442\u043e-\u0442\u043e \u0442\u0430\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u043f\u0430\u0440\u044b \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435:<\/p>\n<p><code>hashTable.Add(\"company\", \"Itransition\");<\/code><\/p>\n<p><code>hashTable.Add(56, \"numberKey\");<\/code><\/p>\n<p>\u041d\u043e \u0442\u0443\u0442 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e: \u0438 \u043a\u043b\u044e\u0447 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0447\u0435\u043c \u0443\u0433\u043e\u0434\u043d\u043e, \u0447\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0438 \u043a\u043b\u044e\u0447, \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 <strong>object<\/strong>, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 boxing\/unboxing. \u0410 \u044d\u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u2013 \u043a\u0430\u043a \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u0430\u043a \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0412 \u043e\u0431\u0449\u0435\u043c, \u0432 \u044f\u0432\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0438\u043c \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/p>\n<h2>Dictionary&lt;TKey,TValue><\/h2>\n<p>\u041b\u044e\u0431\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a .Net, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043b\u044b\u0448\u0438\u0442 \u0441\u043b\u043e\u0432\u043e Dictionary, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0431\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0432\u0438\u0434\u0430:<\/p>\n<p><code>var dictionary = new Dictionary&lt;TKey, TValue>();<\/code><\/p>\n<p>\u0433\u0434\u0435 TKey \u2013 \u044d\u0442\u043e \u043a\u043b\u044e\u0447, \u0430 TValue \u2013 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u044d\u0442\u043e\u043c\u0443 \u043a\u043b\u044e\u0447\u0443. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0447\u0435\u043d\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043f\u043e\u0438\u0441\u043a\u0430, \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0438 \u043e\u0431\u044a\u0435\u043c\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 O(1), \u0432 \u0445\u0443\u0434\u0448\u0435\u043c \u0436\u0435 O(n) \u2013 \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u0442\u0430\u043a, \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0437\u0430 \u0440\u0430\u043c\u043a\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0448\u0438\u043a\u0430\u0440\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, dictionary \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 HashTable, \u043d\u043e \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c dictionary \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d, \u0442.\u0435. \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u0437\u0434\u0430\u043b dictionary \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439 \u0442\u0438\u043f \u0447\u0438\u0441\u043b\u043e, \u0430 \u0434\u043b\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u043e\u0442\u0438\u043a\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u043e\u043d \u0443\u0436\u0435 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u2013 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0442\u0438\u0432) \u2013 \u0438 \u044d\u0442\u043e \u0443\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 boxing\/unboxing, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c, \u0442\u043e dictionary \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0448\u0438\u043a\u0430\u0440\u043d\u044b\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<\/p>\n<h2>ConcurrentDictionary&lt;TKey,TValue><\/h2>\n<p>\u0412\u043e\u0442 \u044d\u0442\u043e \u0448\u0442\u0443\u043a\u0430 \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0443\u0442\u0430\u044f \u2013 \u0432 \u043c\u0438\u0440\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u0445\u043e\u0442\u044f\u0442 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434, \u044d\u0442\u043e\u0442 \u0432\u0438\u0434 dictionary \u043a\u0430\u043a \u044d\u043b\u0438\u043a\u0441\u0438\u0440 \u0436\u0438\u0437\u043d\u0438 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u043b\u0430\u043a\u043e\u043d\u0435. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 Monitor, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0448\u0430\u0435\u0442 lock \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u043b\u044e\u0447\u0443, \u0447\u0442\u043e \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0434\u0432\u0443\u0445 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u041a\u0430\u043a \u0440\u0430\u0437 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0438, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e <strong>Try<\/strong> \u2013 TryAdd(), TryUpdate(), TryDelete()<br \/>\u041d\u043e \u0432\u0434\u0440\u0443\u0433 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0436\u0438\u0437\u043d\u044c, \u0442\u043e\u0433\u0434\u0430 \u0434\u043b\u044f \u0432\u0430\u0441 \u0435\u0441\u0442\u044c\u00a0<\/p>\n<p><code>Hashtable.Synchronized(hashTable);<\/code><\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 HashTable \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u043d, \u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442 \u0438 \u043a\u043b\u044e\u0447, \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 object \u2013 \u0438 \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 boxing\/unboxing.<\/p>\n<h2>ImmutableDictionary&lt;TKey,TValue><\/h2>\n<p>\u041a\u0430\u043a \u0438 <strong>ConcurrentDictionary<\/strong>, \u0434\u0430\u043d\u043d\u044b\u0439 \u0432\u0438\u0434 dictionary \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c, \u0442.\u043a. \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0442\u043e \u0443 \u0434\u0430\u043d\u043d\u043e\u0433\u043e dictionary \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 ImmutableDictionary, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u043a\u043e\u043f\u0438\u0435\u0439 \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f, \u043f\u043b\u044e\u0441 \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c, \u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f.<\/p>\n<p>\u0410 \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435, \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e \u043d\u0435 HashTable, \u0430 AVL Tree, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0436\u0435 O(logN). \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 AVL Tree \u0438 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0432 \u043e\u0431\u0449\u0435\u043c, \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<h2>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/h2>\n<p>\u041c\u044b \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u00ab\u043c\u043d\u0435 \u0442\u0430\u043a \u043a\u0430\u0436\u0435\u0442\u0441\u044f\u00bb: \u0446\u0438\u0444\u0440\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043d\u0435\u0436\u0435\u043b\u0438 \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c: \u0432\u0441\u0435 \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u043e, \u0442\u043e \u043e\u0442\u043e\u0440\u0432\u0430\u043d\u043e \u043e\u0442 \u0441\u0442\u0435\u0440\u0435\u043e\u0442\u0438\u043f\u043e\u0432. \u0414\u043b\u044f \u0441\u0435\u0431\u044f \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e BenchmarkDotNet \u2013 \u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f .net \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c: \u043b\u0443\u0447\u0448\u0435\/\u0445\u0443\u0436\u0435 \u0441\u0442\u0430\u043b\u043e \u0438 \u043d\u0430 \u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u0417\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u0443\u0447\u0448\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043a\u043e\u0434. \u0414\u043b\u044f \u043c\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u043a\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0435\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u0438, \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e. \u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <strong>.NET SDK=6.0.101<\/strong><\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7b3\/e23\/dcf\/7b3e23dcffb361b7bede1b607360909c.png\" width=\"296\" height=\"170\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7b3\/e23\/dcf\/7b3e23dcffb361b7bede1b607360909c.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u0432\u0441\u0442\u0430\u0432\u043a\u043e\u0439 100, 1000 \u0438 10000 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Method<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Target<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Mean<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Error<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>StdDev<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Rank<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Allocated<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Dictionary_Add<\/p>\n<\/td>\n<td>\n<p>100<\/p>\n<\/td>\n<td>\n<p>11.50 us<\/p>\n<\/td>\n<td>\n<p>0.036 us<\/p>\n<\/td>\n<td>\n<p>0.032 us<\/p>\n<\/td>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>11 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Hashtable_Add<\/p>\n<\/td>\n<td>\n<p>100<\/p>\n<\/td>\n<td>\n<p>16.33 us<\/p>\n<\/td>\n<td>\n<p>0.282 us<\/p>\n<\/td>\n<td>\n<p>0.325 us<\/p>\n<\/td>\n<td>\n<p>2<\/p>\n<\/td>\n<td>\n<p>14 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ConcurrentDictionary_Add<\/p>\n<\/td>\n<td>\n<p>100<\/p>\n<\/td>\n<td>\n<p>20.34 us<\/p>\n<\/td>\n<td>\n<p>0.072 us<\/p>\n<\/td>\n<td>\n<p>0.060 us<\/p>\n<\/td>\n<td>\n<p>3<\/p>\n<\/td>\n<td>\n<p>25 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ImmutableDictionary_Add<\/p>\n<\/td>\n<td>\n<p>100<\/p>\n<\/td>\n<td>\n<p>62.62 us<\/p>\n<\/td>\n<td>\n<p>0.900 us<\/p>\n<\/td>\n<td>\n<p>0.842 us<\/p>\n<\/td>\n<td>\n<p>4<\/p>\n<\/td>\n<td>\n<p>49 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Dictionary_Add<\/p>\n<\/td>\n<td>\n<p>1000<\/p>\n<\/td>\n<td>\n<p>118.59 us<\/p>\n<\/td>\n<td>\n<p>0.398 us<\/p>\n<\/td>\n<td>\n<p>0.372 us<\/p>\n<\/td>\n<td>\n<p>5<\/p>\n<\/td>\n<td>\n<p>114 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Hashtable_Add<\/p>\n<\/td>\n<td>\n<p>1000<\/p>\n<\/td>\n<td>\n<p>162.68 us<\/p>\n<\/td>\n<td>\n<p>0.968 us<\/p>\n<\/td>\n<td>\n<p>0.905 us<\/p>\n<\/td>\n<td>\n<p>6<\/p>\n<\/td>\n<td>\n<p>140 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ConcurrentDictionary_Add<\/p>\n<\/td>\n<td>\n<p>1000<\/p>\n<\/td>\n<td>\n<p>209.76 us<\/p>\n<\/td>\n<td>\n<p>2.043 us<\/p>\n<\/td>\n<td>\n<p>1.811 us<\/p>\n<\/td>\n<td>\n<p>7<\/p>\n<\/td>\n<td>\n<p>220 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ImmutableDictionary_Add<\/p>\n<\/td>\n<td>\n<p>1000<\/p>\n<\/td>\n<td>\n<p>903.69 us<\/p>\n<\/td>\n<td>\n<p>9.405 us<\/p>\n<\/td>\n<td>\n<p>7.854 us<\/p>\n<\/td>\n<td>\n<p>8<\/p>\n<\/td>\n<td>\n<p>723 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Dictionary_Add<\/p>\n<\/td>\n<td>\n<p>10000<\/p>\n<\/td>\n<td>\n<p>1,254.97 us<\/p>\n<\/td>\n<td>\n<p>11.560 us<\/p>\n<\/td>\n<td>\n<p>10.248 us<\/p>\n<\/td>\n<td>\n<p>9<\/p>\n<\/td>\n<td>\n<p>1,051 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Hashtable_Add<\/p>\n<\/td>\n<td>\n<p>10000<\/p>\n<\/td>\n<td>\n<p>1,903.21 us<\/p>\n<\/td>\n<td>\n<p>27.632 us<\/p>\n<\/td>\n<td>\n<p>25.847 us<\/p>\n<\/td>\n<td>\n<p>10<\/p>\n<\/td>\n<td>\n<p>1,335 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ConcurrentDictionary_Add<\/p>\n<\/td>\n<td>\n<p>10000<\/p>\n<\/td>\n<td>\n<p>2,583.28 us<\/p>\n<\/td>\n<td>\n<p>43.599 us<\/p>\n<\/td>\n<td>\n<p>40.782 us<\/p>\n<\/td>\n<td>\n<p>11<\/p>\n<\/td>\n<td>\n<p>1,782 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ImmutableDictionary_Add<\/p>\n<\/td>\n<td>\n<p>10000<\/p>\n<\/td>\n<td>\n<p>12,779.01 us<\/p>\n<\/td>\n<td>\n<p>206.515 us<\/p>\n<\/td>\n<td>\n<p>183.070 us<\/p>\n<\/td>\n<td>\n<p>12<\/p>\n<\/td>\n<td>\n<p>9,601 KB<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 Dictionary 100 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430 12 \u043d\u0430\u043d\u043e\u0441\u0435\u043a\u0443\u043d\u0434, \u0430 1000 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0437\u0430 120.\u043e\u0442 \u043c\u044b \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043f\u043e\u0447\u0442\u0438 O(1) \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438! HashTable \u0447\u0443\u0442\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u043d\u043e \u043e\u043d \u0445\u0440\u0430\u043d\u0438\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0441\u0435 \u0432 object \u0438 \u043d\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. ConcurrentDictionary \u0435\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u2013 \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u043c\u0438 \u0440\u0430\u0441\u0445\u043e\u0434\u0430\u043c\u0438, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u043c\u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c, \u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0436\u0435 \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0449\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b! \u0421\u0430\u043c\u044b\u0439 \u0436\u0435 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u2013 \u044d\u0442\u043e ImmutableDictionary. \u0435\u0449\u0435 \u043f\u0440\u043e\u0448\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0435\u043c\u0443\u044e \u0438\u043c \u043f\u0430\u043c\u044f\u0442\u044c: \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u043d\u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0443 \u0432\u0441\u0435\u0445 \u0441\u043e\u0431\u0440\u0430\u0442\u044c\u0435\u0432. \u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0441\u0442\u0430\u0432\u043a\u0435 \u0432 \u043d\u043e\u0432\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0438 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c. \u0415\u0449\u0435 \u043f\u0440\u043e\u0448\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043d \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u043f\u0440\u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0435 \u043d\u043e\u0432\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u2013 \u0432\u0441\u0435 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0435\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f HashTable, \u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c AVL Tree, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0442\u0430\u0432\u043a\u0438 O(logN).<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0438\u0437 1000 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438 100, 1000 \u0438 10000 \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u0445.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p><strong>Method<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p><strong>Target<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p><strong>Mean<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p><strong>Error<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p><strong>StdDev<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p><strong>Rank<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Gen 0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p>ConcurrentDictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>100<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p> \u00a0 \u00a0 9.276 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 0.0784 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 0.0695 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>1<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p>Dictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>100<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p> \u00a0 \u00a0 9.374 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 0.0549 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 0.0487 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>1<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p>Hashtable_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>100<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p>\u00a0 \u00a0 10.651 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 0.0537 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 0.0476 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>2<\/p>\n<\/td>\n<td>\n<p>0.7629<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p>ImmutableDictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>100<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p>\u00a0 \u00a0 14.019 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 0.0436 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 0.0340 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>3<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p>ConcurrentDictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>1000<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p>\u00a0 \u00a0 84.548 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 0.2929 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 0.2596 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>4<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p>Dictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>1000<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p>\u00a0 \u00a0 90.155 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 0.3177 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 0.2817 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>5<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p> Hashtable_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>1000<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p> \u00a0 108.548 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 0.4798 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 0.4253 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>6<\/p>\n<\/td>\n<td>\n<p>7.5684<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p> ImmutableDictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>1000<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p> \u00a0 140.010 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 0.2568 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 0.2276 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>7<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p> ConcurrentDictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>10000<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p> \u00a0 891.774 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 3.0775 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 2.7281 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>8<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p> Dictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>10000<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p> \u00a0 936.266 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 2.9327 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 2.7433 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>9<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p> Hashtable_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>10000<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p> 1,082.217 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 7.7229 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 6.8461 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>10<\/p>\n<\/td>\n<td>\n<p>76.1719<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p> ImmutableDictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>10000<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p> 1,391.331 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 4.9817 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 4.4161 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>11<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0422\u0443\u0442 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0443 Dictionary \u0438 ConcurrentDictionary \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435. \u041e\u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u043e\u043d\u0430\u0445. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u0430, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0432\u0441\u0442\u0430\u0432\u043a\u0438, \u0443 \u043e\u0431\u0435\u0438\u0445 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430\u044f \u0438 \u043e\u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0430\u044f, \u0434\u0430\u0436\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f! \u0414\u043b\u044f HashTable \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u043c\u044f\u0442\u044c, \u0430 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u0445 \u0442\u0430\u043a\u043e\u0433\u043e \u043d\u0435\u0442 \u2013 \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e HashTable \u0445\u0440\u0430\u043d\u0438\u0442 \u0438 \u043a\u043b\u044e\u0447, \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 object, \u0438 \u0435\u0441\u0442\u044c \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043d\u0430 boxing\/unboxing\u00a0 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0447\u0438\u0441\u0442\u043a\u0443 \u0432\u043e\u0437\u043d\u0438\u043a\u0448\u0435\u0433\u043e \u043c\u0443\u0441\u043e\u0440\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Garbage Collection. \u0427\u0430\u0441\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u043d\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0438\u0442\u0430\u044f \u043a\u043e\u0434, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0449\u0435 \u0440\u0430\u0437 \u043f\u0440\u0438\u0437\u044b\u0432\u0430\u044e \u0412\u0430\u0441 \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0418 \u0441\u0430\u043c\u044b\u0439 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u0438\u0437 \u0432\u0441\u0435\u0445 \u043e\u043f\u044f\u0442\u044c \u0436\u0435 ImmutableDictionary, \u0447\u0442\u043e \u043d\u0430\u0432\u043e\u0434\u0438\u0442 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043c\u044b\u0441\u043b\u044c: \u043d\u0443\u0436\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u0430\u043a \u0435\u0441\u0442\u044c \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0433\u0434\u0435 ImmutableDictionary \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u2013 \u0442\u0430\u043c, \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u0430 \u2013 \u0432\u043e\u0442 \u0442\u0430\u043a \u043f\u043e\u0432\u043e\u0440\u043e\u0442!<\/p>\n<h2>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0435 \u0438\u0441\u043f\u043e\u0440\u0442\u0438\u0442\u044c<\/h2>\n<p>\u0414\u043b\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 Dictionary (\u044f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043a \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0432\u044b \u0443\u0436\u0435 \u0441 \u0443\u0432\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u0441\u044c \u043a \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445) \u0438 \u0438\u0441\u043f\u043e\u0440\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 257 \u0440\u0430\u0437! \u0411\u0443\u0434\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u043a\u043b\u044e\u0447\u0443 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 TryGetValue, ContainsKey, <strong>\u0440\u0443\u0447\u043d\u043e\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u043a\u043b\u044e\u0447\u0443<\/strong>, <strong>Linq.FirstOrDefault<\/strong>. \u0412\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<figure class=\"bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/172\/f7f\/bb5\/172f7fbb5e00cb5099bdf7b28b2429af.png\" width=\"300\" height=\"168\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/172\/f7f\/bb5\/172f7fbb5e00cb5099bdf7b28b2429af.png\"\/><figcaption><\/figcaption><\/figure>\n<p><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Method<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"119\" width=\"119\">\n<p><strong>Mean<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"107\" width=\"107\">\n<p><strong>Error<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p><strong>StdDev<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Ratio<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>RatioSD<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Gen 0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>GetValueByKeyWithTryGet\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"119\" width=\"119\">\n<p> \u00a0 \u00a0 7.550 ns\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"107\" width=\"107\">\n<p>\u00a0 0.0767 ns\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p>\u00a0 0.0718 ns\u00a0<\/p>\n<\/td>\n<td>\n<p>0.96<\/p>\n<\/td>\n<td>\n<p>0.02<\/p>\n<\/td>\n<td>\n<p>\u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>GetValueByKey\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"119\" width=\"119\">\n<p> \u00a0 \u00a0 7.864 ns\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"107\" width=\"107\">\n<p>\u00a0 0.1307 ns\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p>\u00a0 0.1158 ns\u00a0<\/p>\n<\/td>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>0<\/p>\n<\/td>\n<td>\n<p>\u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>GetValueByKeyManual\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"119\" width=\"119\">\n<p> \u00a0 571.320 ns\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"107\" width=\"107\">\n<p>\u00a0 7.4372 ns\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p>\u00a0 6.5929 ns\u00a0<\/p>\n<\/td>\n<td>\n<p>72.66<\/p>\n<\/td>\n<td>\n<p>1.37<\/p>\n<\/td>\n<td>\n<p>\u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>GetValueByKeyWithLinq\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"119\" width=\"119\">\n<p> 1,839.986 ns\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"107\" width=\"107\">\n<p> 30.7720 ns\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p> 32.9257 ns\u00a0<\/p>\n<\/td>\n<td>\n<p>234.3<\/p>\n<\/td>\n<td>\n<p>5.68<\/p>\n<\/td>\n<td>\n<p>0.0343<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412\u043e\u0442 \u044d\u0442\u043e \u0434\u0430!!! \u041c\u0435\u0436\u0434\u0443 TryGetValue \u0438 FirstOrDefault \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 <strong>257<\/strong> \u0440\u0430\u0437 \u2013 \u0438 \u044d\u0442\u043e \u043d\u0430 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 \u0432 100 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0435\u0449\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0434\u043b\u044f GC, \u043f\u043e\u0434\u0447\u0438\u0449\u0430\u044f \u0437\u0430 \u043d\u0430\u043c\u0438. \u0421 \u0443\u043c\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442\u0435 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<\/p>\n<p><a href=\"https:\/\/github.com\/EvilDrifter\/AboutDictionaries\"><u>\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0442\u043e\u0440\u0438\u0439<\/u><\/a> \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0443 \u0441\u0435\u0431\u044f.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/itransition\/blog\/652083\/\"> https:\/\/habr.com\/ru\/company\/itransition\/blog\/652083\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0416\u0435\u043d\u044f, \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u0432 Itransition \u043a\u0430\u043a backend .Net developer \u2013 \u0438 \u044d\u0442\u043e \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0442\u0435\u043c\u0443. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0442\u0438\u043f\u0430\u0445 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u0432\u0430\u044e\u0442 \u0432 .Net, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e Hash table, \u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438, \u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445, \u0438 \u0434\u0430\u0436\u0435 \u0441\u043b\u0435\u0433\u043a\u0430 \u043e Tree.<\/p>\n<h2>Big O<\/h2>\n<p>\u0414\u043b\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0445\u043e\u0442\u044f-\u0431\u044b \u0432\u0441\u043a\u043e\u043b\u044c\u0437\u044c \u043f\u0440\u043e\u0431\u0435\u0436\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438. \u0417\u0432\u0443\u0447\u0438\u0442 \u0437\u0430\u0443\u043c\u043d\u043e, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. \u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u0438 \u0432\u044b\u0434\u0432\u0438\u0433\u0430\u0442\u044c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e \u043f\u043e\u0447\u0435\u043c\u0443 O(1) \u043b\u0443\u0447\u0448\u0435 O(n), \u043d\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e O(1) \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442. \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u0434\u0432\u0443\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c \u2013 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438 \u043f\u043e \u0437\u0430\u0442\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0438 \u0432\u0440\u0435\u043c\u044f, \u0438 \u043f\u0430\u043c\u044f\u0442\u044c \u043d\u0435 \u0431\u0435\u0437\u0433\u0440\u0430\u043d\u0438\u0447\u043d\u044b, \u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0445 \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0443\u0442\u0438 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f. \u041d\u0430\u043c \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e 3 \u0438\u0437 \u043d\u0438\u0445:<\/p>\n<p><strong>O(1)<\/strong> \u2013 \u0441\u0430\u043c\u044b\u0439 \u0436\u0435\u043b\u0430\u043d\u043d\u044b\u0439, \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0438 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0432 \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u0438. \u041e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0440\u0438 \u043d\u0435\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u043e \u0440\u0430\u0441\u0442\u0443\u0449\u0435\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430 \u0443\u0441\u043b\u043e\u0432\u043d\u0443\u044e \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u044d\u0442\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u0441\u0435\u043a\u0443\u043d\u0434\u0430 \u0438 \u0434\u0435\u043d\u044c, \u043d\u043e \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u044d\u0442\u043e \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u044b\u0442\u044b\u0432\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c.<\/p>\n<p><strong>O(n) \u2013 <\/strong>\u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0445\u0443\u0436\u0435 O(1), \u043d\u043e \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u044b\u0439, \u0430 \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0439. \u041e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0441\u0442\u0435\u0442 \u043b\u0438\u043d\u0435\u0439\u043d\u043e \u0441 \u0440\u043e\u0441\u0442\u043e\u043c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0441\u043b\u0443\u0436\u0438\u0442\u044c \u0410\u0417\u0421 \u2013 \u0432 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043a\u043e\u043b\u043e\u043d\u043a\u0430 \u043a\u0430\u0447\u0430\u0435\u0442 1 \u043b. \u0442\u043e\u043f\u043b\u0438\u0432\u0430: \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u043a\u0430\u0447\u0430\u0442\u044c 100 \u043b\u0438\u0442\u0440\u043e\u0432, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432 100 \u0440\u0430\u0437 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0441 \u0442\u043e\u0439 \u0436\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p><strong>O(logN) \u2013 <\/strong>\u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u0445\u0443\u0436\u0435 O(1), \u043d\u043e \u043b\u0443\u0447\u0448\u0435 O(n). \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e. \u041d\u043e \u0435\u0441\u043b\u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u043d\u043e, \u0442\u043e \u0441\u043c\u044b\u0441\u043b \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0434\u0430\u0435\u0442 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u0432 2 \u0440\u0430\u0437\u0430, \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c (\u043a \u0434\u0435\u0440\u0435\u0432\u044c\u044f\u043c \u043c\u044b \u0435\u0449\u0435 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435), \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u043e\u0444\u0438\u0442 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0435\u043c\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h2>Hashtable<\/h2>\n<p>\u041d\u0430\u0447\u043d\u0435\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437 \u043e HashTable \u2013 \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0441\u0435\u0439\u0447\u0430\u0441 (.net6) \u0438 \u043a\u0430\u043a \u043b\u044e\u0431\u043e\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c:<\/p>\n<p><code>var hashTable = new Hashtable();<\/code><\/p>\n<p>\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0434\u0430\u0436\u0435 \u0447\u0442\u043e-\u0442\u043e \u0442\u0430\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u043f\u0430\u0440\u044b \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435:<\/p>\n<p><code>hashTable.Add(\"company\", \"Itransition\");<\/code><\/p>\n<p><code>hashTable.Add(56, \"numberKey\");<\/code><\/p>\n<p>\u041d\u043e \u0442\u0443\u0442 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e: \u0438 \u043a\u043b\u044e\u0447 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0435 \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0447\u0435\u043c \u0443\u0433\u043e\u0434\u043d\u043e, \u0447\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0438 \u043a\u043b\u044e\u0447, \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 <strong>object<\/strong>, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 boxing\/unboxing. \u0410 \u044d\u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u2013 \u043a\u0430\u043a \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u0430\u043a \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0412 \u043e\u0431\u0449\u0435\u043c, \u0432 \u044f\u0432\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0438\u043c \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.<\/p>\n<h2>Dictionary&lt;TKey,TValue><\/h2>\n<p>\u041b\u044e\u0431\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a .Net, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043b\u044b\u0448\u0438\u0442 \u0441\u043b\u043e\u0432\u043e Dictionary, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0431\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0432\u0438\u0434\u0430:<\/p>\n<p><code>var dictionary = new Dictionary&lt;TKey, TValue>();<\/code><\/p>\n<p>\u0433\u0434\u0435 TKey \u2013 \u044d\u0442\u043e \u043a\u043b\u044e\u0447, \u0430 TValue \u2013 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u044d\u0442\u043e\u043c\u0443 \u043a\u043b\u044e\u0447\u0443. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0447\u0435\u043d\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043f\u043e\u0438\u0441\u043a\u0430, \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0438 \u043e\u0431\u044a\u0435\u043c\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 O(1), \u0432 \u0445\u0443\u0434\u0448\u0435\u043c \u0436\u0435 O(n) \u2013 \u043f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u0442\u0430\u043a, \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0437\u0430 \u0440\u0430\u043c\u043a\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0448\u0438\u043a\u0430\u0440\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, dictionary \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0431\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 HashTable, \u043d\u043e \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c dictionary \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d, \u0442.\u0435. \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u0437\u0434\u0430\u043b dictionary \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439 \u0442\u0438\u043f \u0447\u0438\u0441\u043b\u043e, \u0430 \u0434\u043b\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043a\u043e\u0442\u0438\u043a\u043e\u0432, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u043e\u043d \u0443\u0436\u0435 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u2013 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0442\u0438\u0432) \u2013 \u0438 \u044d\u0442\u043e \u0443\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 boxing\/unboxing, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c, \u0442\u043e dictionary \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0448\u0438\u043a\u0430\u0440\u043d\u044b\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430.<\/p>\n<h2>ConcurrentDictionary&lt;TKey,TValue><\/h2>\n<p>\u0412\u043e\u0442 \u044d\u0442\u043e \u0448\u0442\u0443\u043a\u0430 \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0443\u0442\u0430\u044f \u2013 \u0432 \u043c\u0438\u0440\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u0445\u043e\u0442\u044f\u0442 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0434, \u044d\u0442\u043e\u0442 \u0432\u0438\u0434 dictionary \u043a\u0430\u043a \u044d\u043b\u0438\u043a\u0441\u0438\u0440 \u0436\u0438\u0437\u043d\u0438 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u043b\u0430\u043a\u043e\u043d\u0435. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 Monitor, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0448\u0430\u0435\u0442 lock \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u043a\u043b\u044e\u0447\u0443, \u0447\u0442\u043e \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0438 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0434\u0432\u0443\u0445 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. \u041a\u0430\u043a \u0440\u0430\u0437 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0438, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e <strong>Try<\/strong> \u2013 TryAdd(), TryUpdate(), TryDelete()<br \/>\u041d\u043e \u0432\u0434\u0440\u0443\u0433 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0436\u0438\u0437\u043d\u044c, \u0442\u043e\u0433\u0434\u0430 \u0434\u043b\u044f \u0432\u0430\u0441 \u0435\u0441\u0442\u044c\u00a0<\/p>\n<p><code>Hashtable.Synchronized(hashTable);<\/code><\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 HashTable \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u043d, \u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442 \u0438 \u043a\u043b\u044e\u0447, \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 object \u2013 \u0438 \u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u043c\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 boxing\/unboxing.<\/p>\n<h2>ImmutableDictionary&lt;TKey,TValue><\/h2>\n<p>\u041a\u0430\u043a \u0438 <strong>ConcurrentDictionary<\/strong>, \u0434\u0430\u043d\u043d\u044b\u0439 \u0432\u0438\u0434 dictionary \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c, \u0442.\u043a. \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0442\u043e \u0443 \u0434\u0430\u043d\u043d\u043e\u0433\u043e dictionary \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 ImmutableDictionary, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u043a\u043e\u043f\u0438\u0435\u0439 \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f, \u043f\u043b\u044e\u0441 \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c, \u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f.<\/p>\n<p>\u0410 \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435, \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u0442\u043e \u043d\u0435 HashTable, \u0430 AVL Tree, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u0430 \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0436\u0435 O(logN). \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 AVL Tree \u0438 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u0432 \u043e\u0431\u0449\u0435\u043c, \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<h2>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/h2>\n<p>\u041c\u044b \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u00ab\u043c\u043d\u0435 \u0442\u0430\u043a \u043a\u0430\u0436\u0435\u0442\u0441\u044f\u00bb: \u0446\u0438\u0444\u0440\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043d\u0435\u0436\u0435\u043b\u0438 \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c: \u0432\u0441\u0435 \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u043e, \u0442\u043e \u043e\u0442\u043e\u0440\u0432\u0430\u043d\u043e \u043e\u0442 \u0441\u0442\u0435\u0440\u0435\u043e\u0442\u0438\u043f\u043e\u0432. \u0414\u043b\u044f \u0441\u0435\u0431\u044f \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e BenchmarkDotNet \u2013 \u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f .net \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c: \u043b\u0443\u0447\u0448\u0435\/\u0445\u0443\u0436\u0435 \u0441\u0442\u0430\u043b\u043e \u0438 \u043d\u0430 \u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u0417\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u0443\u0447\u0448\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043a\u043e\u0434. \u0414\u043b\u044f \u043c\u043e\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u043a\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0435\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u0438, \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e. \u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <strong>.NET SDK=6.0.101<\/strong><\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u0432\u0441\u0442\u0430\u0432\u043a\u043e\u0439 100, 1000 \u0438 10000 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Method<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Target<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Mean<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Error<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>StdDev<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Rank<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Allocated<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Dictionary_Add<\/p>\n<\/td>\n<td>\n<p>100<\/p>\n<\/td>\n<td>\n<p>11.50 us<\/p>\n<\/td>\n<td>\n<p>0.036 us<\/p>\n<\/td>\n<td>\n<p>0.032 us<\/p>\n<\/td>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>11 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Hashtable_Add<\/p>\n<\/td>\n<td>\n<p>100<\/p>\n<\/td>\n<td>\n<p>16.33 us<\/p>\n<\/td>\n<td>\n<p>0.282 us<\/p>\n<\/td>\n<td>\n<p>0.325 us<\/p>\n<\/td>\n<td>\n<p>2<\/p>\n<\/td>\n<td>\n<p>14 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ConcurrentDictionary_Add<\/p>\n<\/td>\n<td>\n<p>100<\/p>\n<\/td>\n<td>\n<p>20.34 us<\/p>\n<\/td>\n<td>\n<p>0.072 us<\/p>\n<\/td>\n<td>\n<p>0.060 us<\/p>\n<\/td>\n<td>\n<p>3<\/p>\n<\/td>\n<td>\n<p>25 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ImmutableDictionary_Add<\/p>\n<\/td>\n<td>\n<p>100<\/p>\n<\/td>\n<td>\n<p>62.62 us<\/p>\n<\/td>\n<td>\n<p>0.900 us<\/p>\n<\/td>\n<td>\n<p>0.842 us<\/p>\n<\/td>\n<td>\n<p>4<\/p>\n<\/td>\n<td>\n<p>49 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Dictionary_Add<\/p>\n<\/td>\n<td>\n<p>1000<\/p>\n<\/td>\n<td>\n<p>118.59 us<\/p>\n<\/td>\n<td>\n<p>0.398 us<\/p>\n<\/td>\n<td>\n<p>0.372 us<\/p>\n<\/td>\n<td>\n<p>5<\/p>\n<\/td>\n<td>\n<p>114 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Hashtable_Add<\/p>\n<\/td>\n<td>\n<p>1000<\/p>\n<\/td>\n<td>\n<p>162.68 us<\/p>\n<\/td>\n<td>\n<p>0.968 us<\/p>\n<\/td>\n<td>\n<p>0.905 us<\/p>\n<\/td>\n<td>\n<p>6<\/p>\n<\/td>\n<td>\n<p>140 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ConcurrentDictionary_Add<\/p>\n<\/td>\n<td>\n<p>1000<\/p>\n<\/td>\n<td>\n<p>209.76 us<\/p>\n<\/td>\n<td>\n<p>2.043 us<\/p>\n<\/td>\n<td>\n<p>1.811 us<\/p>\n<\/td>\n<td>\n<p>7<\/p>\n<\/td>\n<td>\n<p>220 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ImmutableDictionary_Add<\/p>\n<\/td>\n<td>\n<p>1000<\/p>\n<\/td>\n<td>\n<p>903.69 us<\/p>\n<\/td>\n<td>\n<p>9.405 us<\/p>\n<\/td>\n<td>\n<p>7.854 us<\/p>\n<\/td>\n<td>\n<p>8<\/p>\n<\/td>\n<td>\n<p>723 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Dictionary_Add<\/p>\n<\/td>\n<td>\n<p>10000<\/p>\n<\/td>\n<td>\n<p>1,254.97 us<\/p>\n<\/td>\n<td>\n<p>11.560 us<\/p>\n<\/td>\n<td>\n<p>10.248 us<\/p>\n<\/td>\n<td>\n<p>9<\/p>\n<\/td>\n<td>\n<p>1,051 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>Hashtable_Add<\/p>\n<\/td>\n<td>\n<p>10000<\/p>\n<\/td>\n<td>\n<p>1,903.21 us<\/p>\n<\/td>\n<td>\n<p>27.632 us<\/p>\n<\/td>\n<td>\n<p>25.847 us<\/p>\n<\/td>\n<td>\n<p>10<\/p>\n<\/td>\n<td>\n<p>1,335 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ConcurrentDictionary_Add<\/p>\n<\/td>\n<td>\n<p>10000<\/p>\n<\/td>\n<td>\n<p>2,583.28 us<\/p>\n<\/td>\n<td>\n<p>43.599 us<\/p>\n<\/td>\n<td>\n<p>40.782 us<\/p>\n<\/td>\n<td>\n<p>11<\/p>\n<\/td>\n<td>\n<p>1,782 KB<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>ImmutableDictionary_Add<\/p>\n<\/td>\n<td>\n<p>10000<\/p>\n<\/td>\n<td>\n<p>12,779.01 us<\/p>\n<\/td>\n<td>\n<p>206.515 us<\/p>\n<\/td>\n<td>\n<p>183.070 us<\/p>\n<\/td>\n<td>\n<p>12<\/p>\n<\/td>\n<td>\n<p>9,601 KB<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0412\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u044b\u0439 Dictionary 100 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u0430 12 \u043d\u0430\u043d\u043e\u0441\u0435\u043a\u0443\u043d\u0434, \u0430 1000 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0437\u0430 120.\u043e\u0442 \u043c\u044b \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043f\u043e\u0447\u0442\u0438 O(1) \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u043e\u0434\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438! HashTable \u0447\u0443\u0442\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u043d\u043e \u043e\u043d \u0445\u0440\u0430\u043d\u0438\u0442 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0441\u0435 \u0432 object \u0438 \u043d\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. ConcurrentDictionary \u0435\u0449\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u2013 \u044d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u043c\u0438 \u0440\u0430\u0441\u0445\u043e\u0434\u0430\u043c\u0438, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u043c\u0438 \u043f\u043e\u0442\u043e\u043a\u043e\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c, \u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0434\u0430\u0436\u0435 \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0449\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b! \u0421\u0430\u043c\u044b\u0439 \u0436\u0435 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u2013 \u044d\u0442\u043e ImmutableDictionary. \u0435\u0449\u0435 \u043f\u0440\u043e\u0448\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0435\u043c\u0443\u044e \u0438\u043c \u043f\u0430\u043c\u044f\u0442\u044c: \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u043d\u0430 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0443 \u0432\u0441\u0435\u0445 \u0441\u043e\u0431\u0440\u0430\u0442\u044c\u0435\u0432. \u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u0441\u0442\u0430\u0432\u043a\u0435 \u0432 \u043d\u043e\u0432\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0438 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c. \u0415\u0449\u0435 \u043f\u0440\u043e\u0448\u0443 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043d \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u043f\u0440\u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0435 \u043d\u043e\u0432\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u2013 \u0432\u0441\u0435 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0435\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f HashTable, \u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c AVL Tree, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0442\u0430\u0432\u043a\u0438 O(logN).<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u0441\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0438\u0437 1000 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u0440\u0438 100, 1000 \u0438 10000 \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u0445.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p><strong>Method<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p><strong>Target<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p><strong>Mean<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p><strong>Error<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p><strong>StdDev<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p><strong>Rank<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Gen 0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p>ConcurrentDictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>100<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p> \u00a0 \u00a0 9.276 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 0.0784 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 0.0695 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>1<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p>Dictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>100<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p> \u00a0 \u00a0 9.374 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 0.0549 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 0.0487 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>1<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p>Hashtable_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>100<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p>\u00a0 \u00a0 10.651 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 0.0537 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 0.0476 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>2<\/p>\n<\/td>\n<td>\n<p>0.7629<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p>ImmutableDictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>100<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p>\u00a0 \u00a0 14.019 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 0.0436 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 0.0340 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>3<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p>ConcurrentDictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>1000<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p>\u00a0 \u00a0 84.548 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 0.2929 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 0.2596 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>4<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p>Dictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>1000<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p>\u00a0 \u00a0 90.155 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 0.3177 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 0.2817 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>5<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p> Hashtable_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>1000<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p> \u00a0 108.548 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 0.4798 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 0.4253 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>6<\/p>\n<\/td>\n<td>\n<p>7.5684<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p> ImmutableDictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>1000<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p> \u00a0 140.010 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 0.2568 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 0.2276 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>7<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p> ConcurrentDictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>10000<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p> \u00a0 891.774 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 3.0775 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 2.7281 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>8<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p> Dictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>10000<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p> \u00a0 936.266 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 2.9327 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 2.7433 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>9<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p> Hashtable_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>10000<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p> 1,082.217 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 7.7229 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 6.8461 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>10<\/p>\n<\/td>\n<td>\n<p>76.1719<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"112\" width=\"112\">\n<p> ImmutableDictionary_Get\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"65\" width=\"65\">\n<p>10000<\/p>\n<\/td>\n<td data-colwidth=\"114\" width=\"114\">\n<p> 1,391.331 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"98\" width=\"98\">\n<p> 4.9817 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"122\" width=\"122\">\n<p> 4.4161 us\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"64\" width=\"64\">\n<p>11<\/p>\n<\/td>\n<td>\n<p> \u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0422\u0443\u0442 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0443 Dictionary \u0438 ConcurrentDictionary \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435. \u041e\u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u043e\u043d\u0430\u0445. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u043e\u0438\u0441\u043a\u0430, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0432\u0441\u0442\u0430\u0432\u043a\u0438, \u0443 \u043e\u0431\u0435\u0438\u0445 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430\u044f \u0438 \u043e\u043d\u0430 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0430\u044f, \u0434\u0430\u0436\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u0430\u044f! \u0414\u043b\u044f HashTable \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u043c\u044f\u0442\u044c, \u0430 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u0445 \u0442\u0430\u043a\u043e\u0433\u043e \u043d\u0435\u0442 \u2013 \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e HashTable \u0445\u0440\u0430\u043d\u0438\u0442 \u0438 \u043a\u043b\u044e\u0447, \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435 object, \u0438 \u0435\u0441\u0442\u044c \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043d\u0430 boxing\/unboxing\u00a0 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0447\u0438\u0441\u0442\u043a\u0443 \u0432\u043e\u0437\u043d\u0438\u043a\u0448\u0435\u0433\u043e \u043c\u0443\u0441\u043e\u0440\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Garbage Collection. \u0427\u0430\u0441\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u043d\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0438\u0442\u0430\u044f \u043a\u043e\u0434, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0449\u0435 \u0440\u0430\u0437 \u043f\u0440\u0438\u0437\u044b\u0432\u0430\u044e \u0412\u0430\u0441 \u0438\u0437\u043c\u0435\u0440\u044f\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0418 \u0441\u0430\u043c\u044b\u0439 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u0438\u0437 \u0432\u0441\u0435\u0445 \u043e\u043f\u044f\u0442\u044c \u0436\u0435 ImmutableDictionary, \u0447\u0442\u043e \u043d\u0430\u0432\u043e\u0434\u0438\u0442 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043c\u044b\u0441\u043b\u044c: \u043d\u0443\u0436\u043d\u043e \u043e\u0447\u0435\u043d\u044c \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0442\u0430\u043a \u0435\u0441\u0442\u044c \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0433\u0434\u0435 ImmutableDictionary \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u2013 \u0442\u0430\u043c, \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u0431\u044b\u043b\u0430 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u0430 \u2013 \u0432\u043e\u0442 \u0442\u0430\u043a \u043f\u043e\u0432\u043e\u0440\u043e\u0442!<\/p>\n<h2>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0435 \u0438\u0441\u043f\u043e\u0440\u0442\u0438\u0442\u044c<\/h2>\n<p>\u0414\u043b\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 Dictionary (\u044f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043a \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u0432\u044b \u0443\u0436\u0435 \u0441 \u0443\u0432\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u0441\u044c \u043a \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445) \u0438 \u0438\u0441\u043f\u043e\u0440\u0442\u0438\u0442\u044c \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 257 \u0440\u0430\u0437! \u0411\u0443\u0434\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u043a\u043b\u044e\u0447\u0443 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434 TryGetValue, ContainsKey, <strong>\u0440\u0443\u0447\u043d\u043e\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u043a\u043b\u044e\u0447\u0443<\/strong>, <strong>Linq.FirstOrDefault<\/strong>. \u0412\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b:<\/p>\n<figure class=\"bordered\"><figcaption><\/figcaption><\/figure>\n<p><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>Method<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"119\" width=\"119\">\n<p><strong>Mean<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"107\" width=\"107\">\n<p><strong>Error<\/strong><\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p><strong>StdDev<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Ratio<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>RatioSD<\/strong><\/p>\n<\/td>\n<td>\n<p><strong>Gen 0<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>GetValueByKeyWithTryGet\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"119\" width=\"119\">\n<p> \u00a0 \u00a0 7.550 ns\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"107\" width=\"107\">\n<p>\u00a0 0.0767 ns\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p>\u00a0 0.0718 ns\u00a0<\/p>\n<\/td>\n<td>\n<p>0.96<\/p>\n<\/td>\n<td>\n<p>0.02<\/p>\n<\/td>\n<td>\n<p>\u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>GetValueByKey\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"119\" width=\"119\">\n<p> \u00a0 \u00a0 7.864 ns\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"107\" width=\"107\">\n<p>\u00a0 0.1307 ns\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p>\u00a0 0.1158 ns\u00a0<\/p>\n<\/td>\n<td>\n<p>1<\/p>\n<\/td>\n<td>\n<p>0<\/p>\n<\/td>\n<td>\n<p>\u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>GetValueByKeyManual\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"119\" width=\"119\">\n<p> \u00a0 571.320 ns\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"107\" width=\"107\">\n<p>\u00a0 7.4372 ns\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p>\u00a0 6.5929 ns\u00a0<\/p>\n<\/td>\n<td>\n<p>72.66<\/p>\n<\/td>\n<td>\n<p>1.37<\/p>\n<\/td>\n<td>\n<p>\u00a0 \u00a0 \u00a0 &#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>GetValueByKeyWithLinq\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"119\" width=\"119\">\n<p> 1,839.986 ns\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"107\" width=\"107\">\n<p> 30.7720 ns\u00a0<\/p>\n<\/td>\n<td data-colwidth=\"108\" width=\"108\">\n<p> 32.9257 ns\u00a0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-329758","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/329758","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=329758"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/329758\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=329758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=329758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=329758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}