{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/3408","repository_url":"https://api.github.com/repos/dotnet/coreclr","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/3408/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/3408/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/3408/events","html_url":"https://github.com/dotnet/coreclr/issues/3408","id":136912297,"number":3408,"title":"JIT's allocator performance seems to be low","user":{"login":"mikedn","id":9973420,"avatar_url":"https://avatars.githubusercontent.com/u/9973420?v=3","gravatar_id":"","url":"https://api.github.com/users/mikedn","html_url":"https://github.com/mikedn","followers_url":"https://api.github.com/users/mikedn/followers","following_url":"https://api.github.com/users/mikedn/following{/other_user}","gists_url":"https://api.github.com/users/mikedn/gists{/gist_id}","starred_url":"https://api.github.com/users/mikedn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikedn/subscriptions","organizations_url":"https://api.github.com/users/mikedn/orgs","repos_url":"https://api.github.com/users/mikedn/repos","events_url":"https://api.github.com/users/mikedn/events{/privacy}","received_events_url":"https://api.github.com/users/mikedn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/coreclr/labels/CodeGen","name":"CodeGen","color":"d4c5f9"},{"url":"https://api.github.com/repos/dotnet/coreclr/labels/optimization","name":"optimization","color":"0052cc"}],"state":"open","locked":false,"assignee":{"login":"pkukol","id":148817,"avatar_url":"https://avatars.githubusercontent.com/u/148817?v=3","gravatar_id":"","url":"https://api.github.com/users/pkukol","html_url":"https://github.com/pkukol","followers_url":"https://api.github.com/users/pkukol/followers","following_url":"https://api.github.com/users/pkukol/following{/other_user}","gists_url":"https://api.github.com/users/pkukol/gists{/gist_id}","starred_url":"https://api.github.com/users/pkukol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkukol/subscriptions","organizations_url":"https://api.github.com/users/pkukol/orgs","repos_url":"https://api.github.com/users/pkukol/repos","events_url":"https://api.github.com/users/pkukol/events{/privacy}","received_events_url":"https://api.github.com/users/pkukol/received_events","type":"User","site_admin":false},"assignees":[{"login":"pkukol","id":148817,"avatar_url":"https://avatars.githubusercontent.com/u/148817?v=3","gravatar_id":"","url":"https://api.github.com/users/pkukol","html_url":"https://github.com/pkukol","followers_url":"https://api.github.com/users/pkukol/followers","following_url":"https://api.github.com/users/pkukol/following{/other_user}","gists_url":"https://api.github.com/users/pkukol/gists{/gist_id}","starred_url":"https://api.github.com/users/pkukol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkukol/subscriptions","organizations_url":"https://api.github.com/users/pkukol/orgs","repos_url":"https://api.github.com/users/pkukol/repos","events_url":"https://api.github.com/users/pkukol/events{/privacy}","received_events_url":"https://api.github.com/users/pkukol/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/dotnet/coreclr/milestones/5","html_url":"https://github.com/dotnet/coreclr/milestones/Future","labels_url":"https://api.github.com/repos/dotnet/coreclr/milestones/5/labels","id":1328081,"number":5,"title":"Future","description":"Milestone tracking the issues that have been triaged for after 1.0.0-rtm","creator":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars.githubusercontent.com/u/1302850?v=3","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":565,"closed_issues":315,"state":"open","created_at":"2015-09-29T00:26:07Z","updated_at":"2016-09-19T16:05:18Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-02-27T12:15:05Z","updated_at":"2016-09-19T17:39:54Z","closed_at":null,"body":"I profiled `crossgen mscorlib.dll` out of curiosity and noticed that ~5% of the time is spent in `VirtualFree`. These free calls come from the `ArenaAllocator` (formerly known as `norls_allocator`). It's kind of funny that freeing memory takes about the same time as other JIT actions that do actual work (for example, `SsaBuilder::Build` takes ~5% as well).\r\n\r\nI suspect that this happens because the allocator's page is 64 kbytes and as a result a lot of pages are allocated and a lot of free calls have to be made. Though it's peculiar that allocation is very fast (time spent in `VirtualAlloc` is less than 1%), perhaps this is a Windows kernel issue.\r\n\r\nIn any case, 64 kbytes seems too low for 64 bit architectures. I tried with 1 megabyte and `crossgen mscorlib.dll` time drops down from ~6.8 seconds to ~6.0 seconds.\r\n\r\n@pgavlin Perhaps you'll find this interesting, as far as I understand from your recent commit you're planning to do some more work around the allocator."},"comment":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/comments/248064542","html_url":"https://github.com/dotnet/coreclr/issues/3408#issuecomment-248064542","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/3408","id":248064542,"user":{"login":"pkukol","id":148817,"avatar_url":"https://avatars.githubusercontent.com/u/148817?v=3","gravatar_id":"","url":"https://api.github.com/users/pkukol","html_url":"https://github.com/pkukol","followers_url":"https://api.github.com/users/pkukol/followers","following_url":"https://api.github.com/users/pkukol/following{/other_user}","gists_url":"https://api.github.com/users/pkukol/gists{/gist_id}","starred_url":"https://api.github.com/users/pkukol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkukol/subscriptions","organizations_url":"https://api.github.com/users/pkukol/orgs","repos_url":"https://api.github.com/users/pkukol/repos","events_url":"https://api.github.com/users/pkukol/events{/privacy}","received_events_url":"https://api.github.com/users/pkukol/received_events","type":"User","site_admin":false},"created_at":"2016-09-19T17:39:54Z","updated_at":"2016-09-19T17:39:54Z","body":"Thanks for getting those measurements - the results basically jive with what I've seen. The allocator I think is initialized before we know much about the IL so we may not have the data available for the initial chunk, but after that we should probably add at least 128 or 256K at a pop and, for bonus points, come up with a simple heuristic based on whatever we think is easy to gauge and is relevant. Does this sound like a reasonable plan?"}}
{"actor":{"display_login":"pkukol"}}