{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/130","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/130/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/130/events","html_url":"https://github.com/JuliaLang/julia/issues/130","id":1238642,"number":130,"title":"implement zeros() by calling calloc","user":{"login":"StefanKarpinski","id":153596,"avatar_url":"https://avatars.githubusercontent.com/u/153596?v=3","gravatar_id":"","url":"https://api.github.com/users/StefanKarpinski","html_url":"https://github.com/StefanKarpinski","followers_url":"https://api.github.com/users/StefanKarpinski/followers","following_url":"https://api.github.com/users/StefanKarpinski/following{/other_user}","gists_url":"https://api.github.com/users/StefanKarpinski/gists{/gist_id}","starred_url":"https://api.github.com/users/StefanKarpinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefanKarpinski/subscriptions","organizations_url":"https://api.github.com/users/StefanKarpinski/orgs","repos_url":"https://api.github.com/users/StefanKarpinski/repos","events_url":"https://api.github.com/users/StefanKarpinski/events{/privacy}","received_events_url":"https://api.github.com/users/StefanKarpinski/received_events","type":"User","site_admin":false},"labels":[{"id":208968668,"url":"https://api.github.com/repos/JuliaLang/julia/labels/intro%20issue","name":"intro issue","color":"0052cc","default":false},{"id":115858,"url":"https://api.github.com/repos/JuliaLang/julia/labels/performance","name":"performance","color":"d7e102","default":false},{"id":232418,"url":"https://api.github.com/repos/JuliaLang/julia/labels/up%20for%20grabs","name":"up for grabs","color":"0b02e1","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":41,"created_at":"2011-07-17T20:58:09Z","updated_at":"2016-11-04T03:33:21Z","closed_at":null,"body":"There's a clever trick that we could use to create large zero matrices really fast: mmap the file `/dev/zero`. This is, in fact, exactly what this \"file\" exists for. The benefit of doing this are:\n1. It's nearly instantaneous since no memory actually needs to be allocated or filled with zeros until it's accessed.\n2. You can read and write the memory exactly as you normally would: the kernel only allocates memory pages for you when you do something with them.\n\nSince a fair amount of the time, no one actually touches most of the memory in a zeros array, this might be a big win. On the other hand, the drawbacks are:\n1. Trade obvious immediate allocation cost for unobvious delayed allocation cost.\n2. Can run out of memory on read/write instead of only on allocate.\n3. Doesn't work for anything but `zeros()`, e.g. for `ones()`.\n"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/258337244","html_url":"https://github.com/JuliaLang/julia/issues/130#issuecomment-258337244","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/130","id":258337244,"user":{"login":"yuyichao","id":712232,"avatar_url":"https://avatars.githubusercontent.com/u/712232?v=3","gravatar_id":"","url":"https://api.github.com/users/yuyichao","html_url":"https://github.com/yuyichao","followers_url":"https://api.github.com/users/yuyichao/followers","following_url":"https://api.github.com/users/yuyichao/following{/other_user}","gists_url":"https://api.github.com/users/yuyichao/gists{/gist_id}","starred_url":"https://api.github.com/users/yuyichao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuyichao/subscriptions","organizations_url":"https://api.github.com/users/yuyichao/orgs","repos_url":"https://api.github.com/users/yuyichao/repos","events_url":"https://api.github.com/users/yuyichao/events{/privacy}","received_events_url":"https://api.github.com/users/yuyichao/received_events","type":"User","site_admin":false},"created_at":"2016-11-04T03:33:21Z","updated_at":"2016-11-04T03:33:21Z","body":"> And looking at the `isaligned` field more closely, I see that I can't get rid of it, because of `jl_ptr_to_array`.\r\n\r\n`jl_ptr_to_array` can't be resized AFAICT.\r\n"}}
{"actor":{"display_login":"yuyichao"}}