{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/13400","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/13400/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/13400/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/13400/events","html_url":"https://github.com/JuliaLang/julia/issues/13400","id":109246114,"number":13400,"title":"Slow sparse() construction for matrices with lots of rows","user":{"login":"ViralBShah","id":744411,"avatar_url":"https://avatars.githubusercontent.com/u/744411?v=3","gravatar_id":"","url":"https://api.github.com/users/ViralBShah","html_url":"https://github.com/ViralBShah","followers_url":"https://api.github.com/users/ViralBShah/followers","following_url":"https://api.github.com/users/ViralBShah/following{/other_user}","gists_url":"https://api.github.com/users/ViralBShah/gists{/gist_id}","starred_url":"https://api.github.com/users/ViralBShah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ViralBShah/subscriptions","organizations_url":"https://api.github.com/users/ViralBShah/orgs","repos_url":"https://api.github.com/users/ViralBShah/repos","events_url":"https://api.github.com/users/ViralBShah/events{/privacy}","received_events_url":"https://api.github.com/users/ViralBShah/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/performance","name":"performance","color":"d7e102"},{"url":"https://api.github.com/repos/JuliaLang/julia/labels/sparse","name":"sparse","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-01T07:42:08Z","updated_at":"2015-10-04T15:59:10Z","closed_at":null,"body":"This is slow mainly because a CSR data structure is created that allocates a vector of size 100 million, before creating the CSC.\r\n\r\n````\r\njulia> @time sparse([1;100000000], [1;1], [1;1])\r\n  2.237388 seconds (20 allocations: 2.235 GB, 8.30% gc time)\r\n100000000x1 sparse matrix with 2 Int64 entries:\r\n\t[1        ,         1]  =  1\r\n\t[100000000,         1]  =  1\r\n````"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/145362033","html_url":"https://github.com/JuliaLang/julia/issues/13400#issuecomment-145362033","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/13400","id":145362033,"user":{"login":"ScottPJones","id":11798751,"avatar_url":"https://avatars.githubusercontent.com/u/11798751?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottPJones","html_url":"https://github.com/ScottPJones","followers_url":"https://api.github.com/users/ScottPJones/followers","following_url":"https://api.github.com/users/ScottPJones/following{/other_user}","gists_url":"https://api.github.com/users/ScottPJones/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottPJones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottPJones/subscriptions","organizations_url":"https://api.github.com/users/ScottPJones/orgs","repos_url":"https://api.github.com/users/ScottPJones/repos","events_url":"https://api.github.com/users/ScottPJones/events{/privacy}","received_events_url":"https://api.github.com/users/ScottPJones/received_events","type":"User","site_admin":false},"created_at":"2015-10-04T15:59:10Z","updated_at":"2015-10-04T15:59:10Z","body":"I am currently testing a new sparse implementation, which, at least for this case, is > 50x faster for this case (at least on my machine), using the techniques I described in my the comments in #12998, (which unfortunately have now been deleted).  I've also written some improved code to benchmark various sparse operations, based on the code from @mb1234 (https://github.com/JuliaLang/julia/issues/12981#issuecomment-138122760).\r\nThe benchmark routines display elapsed time (std), gc time (std), mem allocation, for each test,\r\nand run gc() before each run.\r\nI will put these in my GitHub repository if you are interested."}}