{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/11787","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/11787/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/11787/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/11787/events","html_url":"https://github.com/JuliaLang/julia/issues/11787","id":89789030,"number":11787,"title":"For Loop Slowdown","user":{"login":"JaredCrean2","id":10292902,"avatar_url":"https://avatars.githubusercontent.com/u/10292902?v=3","gravatar_id":"","url":"https://api.github.com/users/JaredCrean2","html_url":"https://github.com/JaredCrean2","followers_url":"https://api.github.com/users/JaredCrean2/followers","following_url":"https://api.github.com/users/JaredCrean2/following{/other_user}","gists_url":"https://api.github.com/users/JaredCrean2/gists{/gist_id}","starred_url":"https://api.github.com/users/JaredCrean2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JaredCrean2/subscriptions","organizations_url":"https://api.github.com/users/JaredCrean2/orgs","repos_url":"https://api.github.com/users/JaredCrean2/repos","events_url":"https://api.github.com/users/JaredCrean2/events{/privacy}","received_events_url":"https://api.github.com/users/JaredCrean2/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/regression","name":"regression","color":"ff2510"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-06-20T16:30:42Z","updated_at":"2015-06-24T19:52:36Z","closed_at":null,"body":"I was testing a few different ways to calculate a quantity over an array, and noticed for loops slowed down significantly from commit 317a4d1* (16 days old master). @timholy suggested I file an issue here.  \r\nThe test code is here: https://github.com/JaredCrean2/julia_tests/tree/master/array_speed2.  It does the calculating using a manually inlined double for loop, ArrayViews, and SubArrays.\r\n\r\nUsing Julia Version 0.4.0-dev+5149 (2015-06-01 18:58 UTC) Commit 317a4d1* (16 days old master)\r\n```\r\n 592.426 milliseconds (14232 allocations: 586 KB)\r\ndouble loop @time printed above\r\n 495.138 milliseconds (14422 allocations: 599 KB)\r\nArrayView @time printed above\r\n  15.753 seconds      (300 M allocations: 8240 MB, 3.39% gc time)\r\nslice @time printed above\r\n```\r\nUsing Julia Version 0.4.0-dev+5439 (2015-06-18 13:48 UTC) Commit a23caa0* (0 days old master):\r\n```\r\n   1.720 seconds      (102 k allocations: 3600 KB)\r\ndouble loop @time printed above\r\n 566.122 milliseconds (16237 allocations: 692 KB)\r\nArrayView @time printed above\r\n   4.137 seconds      (240 M allocations: 8240 MB, 12.96% gc time)\r\nslice @time printed above\r\n```\r\n\r\nI looked at `@code_warntye getEulerFlux(q,F)`, and the a23caa0 produced a huge amount of code (>1100 lines) compared to the 317a4d1 (~70 lines), and included many lines that looked like\r\n\r\n```julia\r\n(top(throw_boundserror))(q::Array{Float64,3},GenSym(45))::Union{}\r\n```\r\n\r\nthat were not present in 317a4d1.  "},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/114992315","html_url":"https://github.com/JuliaLang/julia/issues/11787#issuecomment-114992315","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/11787","id":114992315,"user":{"login":"mbauman","id":154641,"avatar_url":"https://avatars.githubusercontent.com/u/154641?v=3","gravatar_id":"","url":"https://api.github.com/users/mbauman","html_url":"https://github.com/mbauman","followers_url":"https://api.github.com/users/mbauman/followers","following_url":"https://api.github.com/users/mbauman/following{/other_user}","gists_url":"https://api.github.com/users/mbauman/gists{/gist_id}","starred_url":"https://api.github.com/users/mbauman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbauman/subscriptions","organizations_url":"https://api.github.com/users/mbauman/orgs","repos_url":"https://api.github.com/users/mbauman/repos","events_url":"https://api.github.com/users/mbauman/events{/privacy}","received_events_url":"https://api.github.com/users/mbauman/received_events","type":"User","site_admin":false},"created_at":"2015-06-24T19:52:35Z","updated_at":"2015-06-24T19:52:35Z","body":"I'm trying to dig into this one a bit more.  With my latest performance fixes (#11833 + #11843), we're much improved (I've duplicated the `@time` lines to separate out compilation time):\r\n\r\n```txt\r\n$ ./julia tmp/arrayspeed/main.jl\r\n   1.138 seconds      (22783 allocations: 948 KB)\r\n 527.508 milliseconds (4 allocations: 144 bytes)\r\ndouble loop @time printed above\r\n 600.666 milliseconds (38441 allocations: 1635 KB)\r\n 560.828 milliseconds (4 allocations: 144 bytes)\r\nArrayView @time printed above\r\n   3.274 seconds      (120 M allocations: 4581 MB, 8.19% gc time)\r\n   3.116 seconds      (120 M allocations: 4578 MB, 8.66% gc time)\r\nslice @time printed above\r\n```\r\n\r\nNow the question is if the regression that was introduced in https://github.com/JuliaLang/julia/commit/dadf2439ee464378a4562e13bc8017859838bf4e was coupled to this or not…"}}