{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/17000","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/17000/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/17000/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/17000/events","html_url":"https://github.com/JuliaLang/julia/issues/17000","id":161003591,"number":17000,"title":"FFT in Julia is an order of magnitude slower than in Octave","user":{"login":"loganwilliams","id":823027,"avatar_url":"https://avatars.githubusercontent.com/u/823027?v=3","gravatar_id":"","url":"https://api.github.com/users/loganwilliams","html_url":"https://github.com/loganwilliams","followers_url":"https://api.github.com/users/loganwilliams/followers","following_url":"https://api.github.com/users/loganwilliams/following{/other_user}","gists_url":"https://api.github.com/users/loganwilliams/gists{/gist_id}","starred_url":"https://api.github.com/users/loganwilliams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loganwilliams/subscriptions","organizations_url":"https://api.github.com/users/loganwilliams/orgs","repos_url":"https://api.github.com/users/loganwilliams/repos","events_url":"https://api.github.com/users/loganwilliams/events{/privacy}","received_events_url":"https://api.github.com/users/loganwilliams/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/decision","name":"decision","color":"F08000"},{"url":"https://api.github.com/repos/JuliaLang/julia/labels/needs-docs","name":"needs-docs","color":"d4c5f9"},{"url":"https://api.github.com/repos/JuliaLang/julia/labels/performance","name":"performance","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":32,"created_at":"2016-06-18T03:00:25Z","updated_at":"2016-08-02T10:31:57Z","closed_at":null,"body":"I've noticed that Julia is an order of magnitude slower to compute FFTs than GNU Octave. This discrepancy in speed confuses me, given that bought Octave and Julia ought to be calling the same FFTW library. Is this expected?\r\n\r\nTimes for Julia:\r\n\r\n```\r\njulia> R = rand(512,512);\r\njulia> @time fft(R);\r\n  0.042149 seconds (76 allocations: 8.003 MB)\r\n\r\njulia> R = rand(5000,5000);\r\njulia> @time fft(R);\r\n  6.212666 seconds (76 allocations: 762.943 MB, 1.17% gc time)\r\n```\r\n\r\nTimes for Octave:\r\n\r\n```\r\n>> R = rand(512,512);\r\n>> tic; fft2(R); toc;\r\nElapsed time is 0.00377011 seconds.\r\n\r\n>> R = rand(5000,5000);\r\n>> tic; fft2(R); toc;\r\nElapsed time is 0.556037 seconds.\r\n```\r\n\r\nAfter setting `FFTW.set_num_threads=2`, and using `rfft` instead of `fft`, I saw a small improvement in Julia's performance, but a large discrepancy still remains.\r\n\r\n```\r\njulia> R = rand(512,512);\r\njulia> @time rfft(R);\r\n  0.018692 seconds (93 allocations: 2.012 MB)\r\n\r\njulia> R = rand(5000,5000);\r\njulia> @time rfft(R);\r\n  1.736385 seconds (99 allocations: 190.816 MB, 0.95% gc time)\r\n```\r\n\r\nI have reproduced this issue on my personal computer (OS X 10.11.5), and on a Google Compute Engine VM running Ubuntu 16.04. Here is my Julia `versioninfo()`:\r\n\r\n```\r\nJulia Version 0.4.5\r\nCommit 2ac304d (2016-03-18 00:58 UTC)\r\nPlatform Info:\r\n  System: Darwin (x86_64-apple-darwin13.4.0)\r\n  CPU: Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz\r\n  WORD_SIZE: 64\r\n  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)\r\n  LAPACK: libopenblas64_\r\n  LIBM: libopenlibm\r\n  LLVM: libLLVM-3.3\r\n```"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/236866517","html_url":"https://github.com/JuliaLang/julia/issues/17000#issuecomment-236866517","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/17000","id":236866517,"user":{"login":"amitmurthy","id":117461,"avatar_url":"https://avatars.githubusercontent.com/u/117461?v=3","gravatar_id":"","url":"https://api.github.com/users/amitmurthy","html_url":"https://github.com/amitmurthy","followers_url":"https://api.github.com/users/amitmurthy/followers","following_url":"https://api.github.com/users/amitmurthy/following{/other_user}","gists_url":"https://api.github.com/users/amitmurthy/gists{/gist_id}","starred_url":"https://api.github.com/users/amitmurthy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amitmurthy/subscriptions","organizations_url":"https://api.github.com/users/amitmurthy/orgs","repos_url":"https://api.github.com/users/amitmurthy/repos","events_url":"https://api.github.com/users/amitmurthy/events{/privacy}","received_events_url":"https://api.github.com/users/amitmurthy/received_events","type":"User","site_admin":false},"created_at":"2016-08-02T10:31:57Z","updated_at":"2016-08-02T10:31:57Z","body":"> Why not just put FFTW.set_num_threads(Sys.CPU_CORES) in the julia boot?\r\n\r\nCan complicate things for parallel. Please see https://github.com/JuliaLang/julia/issues/17726#issuecomment-236500858 and comment if the proposal is fine."}}
{"actor":{"display_login":"amitmurthy"}}