{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/209776531","pull_request_review_id":145856687,"id":209776531,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwOTc3NjUzMQ==","diff_hunk":"@@ -787,6 +788,130 @@ internal unsafe int GetNonRandomizedHashCode()\n             }\n         }\n \n+        // Use this if and only if 'Denial of Service' attacks are not a concern (i.e. never used for free-form user input),\n+        // or are otherwise mitigated\n+        internal unsafe int GetNonRandomizedIgnoreCaseHashCode()","path":"src/System.Private.CoreLib/shared/System/String.Comparison.cs","position":14,"original_position":14,"commit_id":"05ee0b9384cb09c21a201212bf7b499d2e893c14","original_commit_id":"31ec133c226d6eda197ba7c503c7c432536ecdc3","user":{"login":"benaadams","id":1142958,"node_id":"MDQ6VXNlcjExNDI5NTg=","avatar_url":"https://avatars1.githubusercontent.com/u/1142958?v=4","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"body":"Tracking issues https://github.com/dotnet/coreclr/issues/19467 and https://github.com/dotnet/coreclr/issues/19468","created_at":"2018-08-13T22:13:52Z","updated_at":"2018-08-13T22:13:52Z","html_url":"https://github.com/dotnet/coreclr/pull/19436#discussion_r209776531","pull_request_url":"https://api.github.com/repos/dotnet/coreclr/pulls/19436","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/209776531"},"html":{"href":"https://github.com/dotnet/coreclr/pull/19436#discussion_r209776531"},"pull_request":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/19436"}},"in_reply_to_id":209442808},"pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/19436","id":207771639,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA3NzcxNjM5","html_url":"https://github.com/dotnet/coreclr/pull/19436","diff_url":"https://github.com/dotnet/coreclr/pull/19436.diff","patch_url":"https://github.com/dotnet/coreclr/pull/19436.patch","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/19436","number":19436,"state":"open","locked":false,"title":"Dict add StringComparer.Ordinal{IgnoreCase} non-randomized optimization","user":{"login":"benaadams","id":1142958,"node_id":"MDQ6VXNlcjExNDI5NTg=","avatar_url":"https://avatars1.githubusercontent.com/u/1142958?v=4","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"body":"+473% / x5.7 speed up for hashing 10 char `StringComparer.OrdinalIgnoreCase` ascii keys in used  `Dictionary<string, TValue>`\r\n\r\n+116% / x2.2 speed up for hashing 10 char `StringComparer.Ordinal` keys in used  `Dictionary<string, TValue>`\r\n\r\nFast path for ascii `StringComparer.OrdinalIgnoreCase` before collisions become high, when it switches to randomised hashing.\r\n\r\nRecognise `StringComparer.Ordinal` in addition to `EqualityComparer<string>.Default` for non-randomized optimization. \r\n\r\n[apisof.net](https://apisof.net/catalog/System.StringComparer.Ordinal) says `StringComparer.Ordinal` has 4.8% usage on NuGet.\r\n\r\n`StringComparer.OrdinalIgnoreCase` version 7.8% usage on NuGet\r\n\r\nResolves dotnet/corefx#28834\r\n\r\nFor ascii input https://github.com/dotnet/coreclr/pull/19436#issuecomment-412384276\r\n```\r\n                      Method |                 Input |       Mean |          Op/s | Scaled |\r\n---------------------------- |---------------------- |-----------:|--------------:|-------:|\r\n     NonRandomizedIgnoreCase |                       |   2.543 ns | 393,239,898.3 |   0.16 |\r\n RandomizedOrdinalIgnoreCase |                       |  16.365 ns |  61,107,451.3 |   1.00 |\r\n                             |                       |            |               |        |\r\n     NonRandomizedIgnoreCase |                     1 |   3.677 ns | 271,977,635.4 |   0.09 |\r\n RandomizedOrdinalIgnoreCase |                     1 |  39.840 ns |  25,100,712.8 |   1.00 |\r\n                             |                       |            |               |        |\r\n     NonRandomizedIgnoreCase |                    12 |   3.681 ns | 271,684,906.0 |   0.09 |\r\n RandomizedOrdinalIgnoreCase |                    12 |  42.557 ns |  23,497,789.0 |   1.00 |\r\n                             |                       |            |               |        |\r\n     NonRandomizedIgnoreCase |                   123 |   5.090 ns | 196,459,260.6 |   0.12 |\r\n RandomizedOrdinalIgnoreCase |                   123 |  42.889 ns |  23,315,996.0 |   1.00 |\r\n                             |                       |            |               |        |\r\n     NonRandomizedIgnoreCase |                  1234 |   5.090 ns | 196,451,630.3 |   0.11 |\r\n RandomizedOrdinalIgnoreCase |                  1234 |  44.283 ns |  22,582,258.6 |   1.00 |\r\n                             |                       |            |               |        |\r\n     NonRandomizedIgnoreCase |                 12345 |   6.220 ns | 160,783,055.6 |   0.14 |\r\n RandomizedOrdinalIgnoreCase |                 12345 |  45.369 ns |  22,041,264.4 |   1.00 |\r\n                             |                       |            |               |        |\r\n     NonRandomizedIgnoreCase |                123456 |   6.226 ns | 160,609,477.0 |   0.13 |\r\n RandomizedOrdinalIgnoreCase |                123456 |  46.565 ns |  21,475,384.8 |   1.00 |\r\n                             |                       |            |               |        |\r\n     NonRandomizedIgnoreCase |               1234567 |   7.879 ns | 126,919,960.7 |   0.17 |\r\n RandomizedOrdinalIgnoreCase |               1234567 |  47.166 ns |  21,201,895.8 |   1.00 |\r\n                             |                       |            |               |        |\r\n     NonRandomizedIgnoreCase |              12345678 |   7.879 ns | 126,916,990.6 |   0.16 |\r\n RandomizedOrdinalIgnoreCase |              12345678 |  48.925 ns |  20,439,378.7 |   1.00 |\r\n                             |                       |            |               |        |\r\n     NonRandomizedIgnoreCase |             123456789 |   8.995 ns | 111,169,928.0 |   0.18 |\r\n RandomizedOrdinalIgnoreCase |             123456789 |  49.784 ns |  20,086,888.1 |   1.00 |\r\n                             |                       |            |               |        |\r\n     NonRandomizedIgnoreCase |            1234567890 |   8.995 ns | 111,173,636.8 |   0.17 |\r\n RandomizedOrdinalIgnoreCase |            1234567890 |  51.606 ns |  19,377,588.1 |   1.00 |\r\n                             |                       |            |               |        |\r\n     NonRandomizedIgnoreCase |  12345678901234567890 |  16.321 ns |  61,271,112.6 |   0.25 |\r\n RandomizedOrdinalIgnoreCase |  12345678901234567890 |  66.322 ns |  15,077,973.9 |   1.00 |\r\n                             |                       |            |               |        |\r\n     NonRandomizedIgnoreCase |  12345(...)67890 [40] |  30.431 ns |  32,861,074.5 |   0.29 |\r\n RandomizedOrdinalIgnoreCase |  12345(...)67890 [40] | 105.175 ns |   9,507,940.1 |   1.00 |\r\n                             |                       |            |               |        |\r\n     NonRandomizedIgnoreCase |  12345(...)67890 [80] |  59.670 ns |  16,758,837.1 |   0.37 |\r\n RandomizedOrdinalIgnoreCase |  12345(...)67890 [80] | 162.946 ns |   6,137,005.6 |   1.00 |\r\n                             |                       |            |               |        |\r\n     NonRandomizedIgnoreCase | 12345(...)67890 [160] | 118.589 ns |   8,432,479.1 |   0.41 |\r\n RandomizedOrdinalIgnoreCase | 12345(...)67890 [160] | 288.826 ns |   3,462,290.7 |   1.00 |\r\n```\r\n\r\n/cc @jkotas @danmosemsft ","created_at":"2018-08-11T11:53:20Z","updated_at":"2018-08-13T22:13:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c14f8ca1154e2c58d9eeadc9a2d6d43a4825257f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/coreclr/pulls/19436/commits","review_comments_url":"https://api.github.com/repos/dotnet/coreclr/pulls/19436/comments","review_comment_url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/19436/comments","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/05ee0b9384cb09c21a201212bf7b499d2e893c14","head":{"label":"benaadams:NonRandomized-StringComparer.Ordinal","ref":"NonRandomized-StringComparer.Ordinal","sha":"05ee0b9384cb09c21a201212bf7b499d2e893c14","user":{"login":"benaadams","id":1142958,"node_id":"MDQ6VXNlcjExNDI5NTg=","avatar_url":"https://avatars1.githubusercontent.com/u/1142958?v=4","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"repo":{"id":30264189,"node_id":"MDEwOlJlcG9zaXRvcnkzMDI2NDE4OQ==","name":"coreclr","full_name":"benaadams/coreclr","owner":{"login":"benaadams","id":1142958,"node_id":"MDQ6VXNlcjExNDI5NTg=","avatar_url":"https://avatars1.githubusercontent.com/u/1142958?v=4","gravatar_id":"","url":"https://api.github.com/users/benaadams","html_url":"https://github.com/benaadams","followers_url":"https://api.github.com/users/benaadams/followers","following_url":"https://api.github.com/users/benaadams/following{/other_user}","gists_url":"https://api.github.com/users/benaadams/gists{/gist_id}","starred_url":"https://api.github.com/users/benaadams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benaadams/subscriptions","organizations_url":"https://api.github.com/users/benaadams/orgs","repos_url":"https://api.github.com/users/benaadams/repos","events_url":"https://api.github.com/users/benaadams/events{/privacy}","received_events_url":"https://api.github.com/users/benaadams/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/benaadams/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR. It is an execution engine for .NET apps, performing functions such as IL byte code loading, compilation to machine code and garbage collection. The repo contains the complete up-to-date CoreCLR codebase.","fork":true,"url":"https://api.github.com/repos/benaadams/coreclr","forks_url":"https://api.github.com/repos/benaadams/coreclr/forks","keys_url":"https://api.github.com/repos/benaadams/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benaadams/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benaadams/coreclr/teams","hooks_url":"https://api.github.com/repos/benaadams/coreclr/hooks","issue_events_url":"https://api.github.com/repos/benaadams/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/benaadams/coreclr/events","assignees_url":"https://api.github.com/repos/benaadams/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/benaadams/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/benaadams/coreclr/tags","blobs_url":"https://api.github.com/repos/benaadams/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benaadams/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benaadams/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/benaadams/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benaadams/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/benaadams/coreclr/languages","stargazers_url":"https://api.github.com/repos/benaadams/coreclr/stargazers","contributors_url":"https://api.github.com/repos/benaadams/coreclr/contributors","subscribers_url":"https://api.github.com/repos/benaadams/coreclr/subscribers","subscription_url":"https://api.github.com/repos/benaadams/coreclr/subscription","commits_url":"https://api.github.com/repos/benaadams/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/benaadams/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/benaadams/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/benaadams/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/benaadams/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/benaadams/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benaadams/coreclr/merges","archive_url":"https://api.github.com/repos/benaadams/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benaadams/coreclr/downloads","issues_url":"https://api.github.com/repos/benaadams/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/benaadams/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/benaadams/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/benaadams/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benaadams/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/benaadams/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/benaadams/coreclr/deployments","created_at":"2015-02-03T20:56:42Z","updated_at":"2018-08-11T11:26:13Z","pushed_at":"2018-08-13T15:15:10Z","git_url":"git://github.com/benaadams/coreclr.git","ssh_url":"git@github.com:benaadams/coreclr.git","clone_url":"https://github.com/benaadams/coreclr.git","svn_url":"https://github.com/benaadams/coreclr","homepage":"","size":232555,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"35dafea02d196d5acb998c8a4fff3e6a37365db8","user":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":30092893,"node_id":"MDEwOlJlcG9zaXRvcnkzMDA5Mjg5Mw==","name":"coreclr","full_name":"dotnet/coreclr","owner":{"login":"dotnet","id":9141961,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDE5NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR, and the base library, called System.Private.Corelib (or mscorlib). It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes. We welcome contributions.","fork":false,"url":"https://api.github.com/repos/dotnet/coreclr","forks_url":"https://api.github.com/repos/dotnet/coreclr/forks","keys_url":"https://api.github.com/repos/dotnet/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/coreclr/teams","hooks_url":"https://api.github.com/repos/dotnet/coreclr/hooks","issue_events_url":"https://api.github.com/repos/dotnet/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/coreclr/events","assignees_url":"https://api.github.com/repos/dotnet/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/coreclr/tags","blobs_url":"https://api.github.com/repos/dotnet/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/coreclr/languages","stargazers_url":"https://api.github.com/repos/dotnet/coreclr/stargazers","contributors_url":"https://api.github.com/repos/dotnet/coreclr/contributors","subscribers_url":"https://api.github.com/repos/dotnet/coreclr/subscribers","subscription_url":"https://api.github.com/repos/dotnet/coreclr/subscription","commits_url":"https://api.github.com/repos/dotnet/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/coreclr/merges","archive_url":"https://api.github.com/repos/dotnet/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/coreclr/downloads","issues_url":"https://api.github.com/repos/dotnet/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/coreclr/deployments","created_at":"2015-01-30T22:10:02Z","updated_at":"2018-08-13T22:05:09Z","pushed_at":"2018-08-13T22:13:30Z","git_url":"git://github.com/dotnet/coreclr.git","ssh_url":"git@github.com:dotnet/coreclr.git","clone_url":"https://github.com/dotnet/coreclr.git","svn_url":"https://github.com/dotnet/coreclr","homepage":"https://github.com/dotnet/core","size":234859,"stargazers_count":9727,"watchers_count":9727,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2403,"mirror_url":null,"archived":false,"open_issues_count":1790,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":2403,"open_issues":1790,"watchers":9727,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/19436"},"html":{"href":"https://github.com/dotnet/coreclr/pull/19436"},"issue":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/19436"},"comments":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/19436/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/19436/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/19436/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/coreclr/statuses/05ee0b9384cb09c21a201212bf7b499d2e893c14"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"benaadams"}}