{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/19298","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/19298/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/19298/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/19298/events","html_url":"https://github.com/JuliaLang/julia/issues/19298","id":188636823,"number":19298,"title":"Code is 200x slower in Julia 0.5 with @fastmath ","user":{"login":"raminammour","id":20540368,"avatar_url":"https://avatars.githubusercontent.com/u/20540368?v=3","gravatar_id":"","url":"https://api.github.com/users/raminammour","html_url":"https://github.com/raminammour","followers_url":"https://api.github.com/users/raminammour/followers","following_url":"https://api.github.com/users/raminammour/following{/other_user}","gists_url":"https://api.github.com/users/raminammour/gists{/gist_id}","starred_url":"https://api.github.com/users/raminammour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raminammour/subscriptions","organizations_url":"https://api.github.com/users/raminammour/orgs","repos_url":"https://api.github.com/users/raminammour/repos","events_url":"https://api.github.com/users/raminammour/events{/privacy}","received_events_url":"https://api.github.com/users/raminammour/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-10T22:33:00Z","updated_at":"2016-11-10T23:07:20Z","closed_at":null,"body":"Hello all,\r\n\r\nI have some code that slowed down from Julia 0.4 to Julia 0.5 by a factor of 200. After some inspection, the culprit was `@fastmath`. It is probably related to some other issues, but I thought it may be helpful for people who have similar slowdown and searching for a quick fix :)\r\n\r\nWeirdly, `@code_warntype` does not show any obvious type instability on my variables (I am no expert on interpreting the output though). \r\n\r\nI unfortunately cannot share the code; anyway, it is too long to be instructive. If I can isolate a reproducible example, I will share it here. Below are the results:\r\n\r\nOn Julia 0.5\r\nWith `@fastmath`:\r\n``` julia\r\n@time  fwd!(c0in, ddout,zeros(nzin,nxin),fin, \"fwd\", param,pout);\r\n 55.891811 seconds (429.08 M allocations: 7.088 GB, 3.27% gc time)\r\n```\r\n\r\nWithout `@fastmath`:\r\n``` julia\r\n@time  fwd!(c0in, ddout,zeros(nzin,nxin),fin, \"fwd\", param,pout);\r\n 0.138615 seconds (1.59 k allocations: 81.074 MB, 18.30% gc time)\r\n```\r\nOn Julia 0.4 with `@fastmath`:\r\n``` julia\r\n@time  fwd!(c0in, ddout,zeros(nzin,nxin),fin, \"fwd\", param,pout);\r\n0.304500 seconds (1.59 k allocations: 81.058 MB, 29.24% gc time)\r\n```\r\n\r\n``` \r\nJulia Version 0.4.6\r\nCommit 2e358ce (2016-06-19 17:16 UTC)\r\nPlatform Info:\r\n  System: Linux (x86_64-unknown-linux-gnu)\r\n  CPU: Intel(R) Xeon(R) CPU E5-4640 0 @ 2.40GHz\r\n  WORD_SIZE: 64\r\n  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)\r\n  LAPACK: libopenblas64_\r\n  LIBM: libopenlibm\r\n  LLVM: libLLVM-3.3\r\n```\r\n\r\n```\r\nJulia Version 0.5.0\r\nCommit 3c9d753 (2016-09-19 18:14 UTC)\r\nPlatform Info:\r\n  System: Linux (x86_64-pc-linux-gnu)\r\n  CPU: Intel(R) Xeon(R) CPU E5-4640 0 @ 2.40GHz\r\n  WORD_SIZE: 64\r\n  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)\r\n  LAPACK: libopenblas64_\r\n  LIBM: libopenlibm\r\n  LLVM: libLLVM-3.7.1 (ORCJIT, sandybridge)\r\n```"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/259834897","html_url":"https://github.com/JuliaLang/julia/issues/19298#issuecomment-259834897","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/19298","id":259834897,"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-10T23:07:20Z","updated_at":"2016-11-10T23:07:20Z","body":"....... you need to use `` ` `` to quote code.....\r\n\r\nThere's nothing we can do without knowing what your problem actually is. You can maybe give some examples one what you are using `@fastmath` on or try to reduce your code to see what actually becomes slower.\r\n"}}
{"actor":{"display_login":"yuyichao"}}