{"action":"created","issue":{"url":"https://api.github.com/repos/android-ndk/ndk/issues/495","repository_url":"https://api.github.com/repos/android-ndk/ndk","labels_url":"https://api.github.com/repos/android-ndk/ndk/issues/495/labels{/name}","comments_url":"https://api.github.com/repos/android-ndk/ndk/issues/495/comments","events_url":"https://api.github.com/repos/android-ndk/ndk/issues/495/events","html_url":"https://github.com/android-ndk/ndk/issues/495","id":253532956,"node_id":"MDU6SXNzdWUyNTM1MzI5NTY=","number":495,"title":"Android NDK Clang produces 23% slower binaries than GCC","user":{"login":"bruenor41","id":26252589,"node_id":"MDQ6VXNlcjI2MjUyNTg5","avatar_url":"https://avatars0.githubusercontent.com/u/26252589?v=4","gravatar_id":"","url":"https://api.github.com/users/bruenor41","html_url":"https://github.com/bruenor41","followers_url":"https://api.github.com/users/bruenor41/followers","following_url":"https://api.github.com/users/bruenor41/following{/other_user}","gists_url":"https://api.github.com/users/bruenor41/gists{/gist_id}","starred_url":"https://api.github.com/users/bruenor41/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bruenor41/subscriptions","organizations_url":"https://api.github.com/users/bruenor41/orgs","repos_url":"https://api.github.com/users/bruenor41/repos","events_url":"https://api.github.com/users/bruenor41/events{/privacy}","received_events_url":"https://api.github.com/users/bruenor41/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"DanAlbert","id":315852,"node_id":"MDQ6VXNlcjMxNTg1Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/315852?v=4","gravatar_id":"","url":"https://api.github.com/users/DanAlbert","html_url":"https://github.com/DanAlbert","followers_url":"https://api.github.com/users/DanAlbert/followers","following_url":"https://api.github.com/users/DanAlbert/following{/other_user}","gists_url":"https://api.github.com/users/DanAlbert/gists{/gist_id}","starred_url":"https://api.github.com/users/DanAlbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanAlbert/subscriptions","organizations_url":"https://api.github.com/users/DanAlbert/orgs","repos_url":"https://api.github.com/users/DanAlbert/repos","events_url":"https://api.github.com/users/DanAlbert/events{/privacy}","received_events_url":"https://api.github.com/users/DanAlbert/received_events","type":"User","site_admin":false},"assignees":[{"login":"DanAlbert","id":315852,"node_id":"MDQ6VXNlcjMxNTg1Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/315852?v=4","gravatar_id":"","url":"https://api.github.com/users/DanAlbert","html_url":"https://github.com/DanAlbert","followers_url":"https://api.github.com/users/DanAlbert/followers","following_url":"https://api.github.com/users/DanAlbert/following{/other_user}","gists_url":"https://api.github.com/users/DanAlbert/gists{/gist_id}","starred_url":"https://api.github.com/users/DanAlbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanAlbert/subscriptions","organizations_url":"https://api.github.com/users/DanAlbert/orgs","repos_url":"https://api.github.com/users/DanAlbert/repos","events_url":"https://api.github.com/users/DanAlbert/events{/privacy}","received_events_url":"https://api.github.com/users/DanAlbert/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/android-ndk/ndk/milestones/6","html_url":"https://github.com/android-ndk/ndk/milestone/6","labels_url":"https://api.github.com/repos/android-ndk/ndk/milestones/6/labels","id":1890305,"node_id":"MDk6TWlsZXN0b25lMTg5MDMwNQ==","number":6,"title":"unplanned","description":"Bucket for things that are not currently planned for any release.","creator":{"login":"DanAlbert","id":315852,"node_id":"MDQ6VXNlcjMxNTg1Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/315852?v=4","gravatar_id":"","url":"https://api.github.com/users/DanAlbert","html_url":"https://github.com/DanAlbert","followers_url":"https://api.github.com/users/DanAlbert/followers","following_url":"https://api.github.com/users/DanAlbert/following{/other_user}","gists_url":"https://api.github.com/users/DanAlbert/gists{/gist_id}","starred_url":"https://api.github.com/users/DanAlbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanAlbert/subscriptions","organizations_url":"https://api.github.com/users/DanAlbert/orgs","repos_url":"https://api.github.com/users/DanAlbert/repos","events_url":"https://api.github.com/users/DanAlbert/events{/privacy}","received_events_url":"https://api.github.com/users/DanAlbert/received_events","type":"User","site_admin":false},"open_issues":38,"closed_issues":19,"state":"open","created_at":"2016-07-18T18:32:36Z","updated_at":"2018-10-19T04:54:05Z","due_on":null,"closed_at":null},"comments":79,"created_at":"2017-08-29T05:26:15Z","updated_at":"2018-10-25T06:18:41Z","closed_at":"2018-10-19T03:50:44Z","author_association":"NONE","body":"--------------------------------------------------------------------------------\r\nSwitching from android gcc to clang produces slower binaries.\r\n\r\n#### Description\r\n\r\nI am working on application what emulates old operating system from 90'. I build c++ binaries with android ndk r10e with gcc 4.8. But, because google drops support for gcc, I want switch to clang. After updating ndk to r15 and successful build, I ran benchmarks(in r15 is default compiler clang, instead gcc like it was in ndk r10e). Result is that emulated system runs 23% slower, even without benchmark it is very noticeable when playing more cpu demanding games.\r\n\r\nI did none changes to Android.mk and I use -O3 for optimizations. I only updated ndk. Simply said, I only switch between toolchains with : \r\nNDK_TOOLCHAIN_VERSION=4.9 or without it\r\n\r\nIn ndk r15 is still possible switch to gcc 4.9. I did it and I got back lost performance. And even more, seems gcc 4.9 makes slightly better optimizations then gcc 4.8. \r\n\r\nFrom what I read on web I expected that clang will produce faster binaries or the same. And I didn't find special magic clang flags what I must enable for Android.mk.\r\n\r\nFor a test I returned back to ndk r10e and switched to clang 3.8. Compiled application is again around 20%+ slower. Seems it is not related to ndk r15, but is there long time.\r\n\r\n#### Environment Details\r\n\r\nIn my application.mk I use this setup \r\n\r\nAPP_ABI := armeabi armeabi-v7a x86\r\nAPP_OPTIM := release\r\nAPP_STL := stlport_static\r\nAPP_PLATFORM := android-8\r\nLOCAL_LDLIBS += -lz \r\n\r\nAPP_PLATFORM is set to 8 but I see in log that minimum was set to 14 automatically\r\n\r\nAndroid.mk\r\nAPP_CPPFLAGS = -O3\r\nLOCAL_ARM_MODE := arm\r\nLOCAL_CFLAGS += -DHAVE_NEON=1\r\nLOCAL_ARM_NEON := true\r\n\r\nI tested on windows 10 and ubuntu 16.04, results are same\r\nTested on device with android 6.0 and 7.0\r\n"},"comment":{"url":"https://api.github.com/repos/android-ndk/ndk/issues/comments/432928538","html_url":"https://github.com/android-ndk/ndk/issues/495#issuecomment-432928538","issue_url":"https://api.github.com/repos/android-ndk/ndk/issues/495","id":432928538,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjkyODUzOA==","user":{"login":"DanAlbert","id":315852,"node_id":"MDQ6VXNlcjMxNTg1Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/315852?v=4","gravatar_id":"","url":"https://api.github.com/users/DanAlbert","html_url":"https://github.com/DanAlbert","followers_url":"https://api.github.com/users/DanAlbert/followers","following_url":"https://api.github.com/users/DanAlbert/following{/other_user}","gists_url":"https://api.github.com/users/DanAlbert/gists{/gist_id}","starred_url":"https://api.github.com/users/DanAlbert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanAlbert/subscriptions","organizations_url":"https://api.github.com/users/DanAlbert/orgs","repos_url":"https://api.github.com/users/DanAlbert/repos","events_url":"https://api.github.com/users/DanAlbert/events{/privacy}","received_events_url":"https://api.github.com/users/DanAlbert/received_events","type":"User","site_admin":false},"created_at":"2018-10-25T06:18:41Z","updated_at":"2018-10-25T06:18:41Z","author_association":"MEMBER","body":"Thanks. It won't be taking priority over other work but I'll keep in my list of Friday projects."}}
{"actor":{"display_login":"DanAlbert"}}