{"action":"created","issue":{"url":"https://api.github.com/repos/bulletphysics/bullet3/issues/482","labels_url":"https://api.github.com/repos/bulletphysics/bullet3/issues/482/labels{/name}","comments_url":"https://api.github.com/repos/bulletphysics/bullet3/issues/482/comments","events_url":"https://api.github.com/repos/bulletphysics/bullet3/issues/482/events","html_url":"https://github.com/bulletphysics/bullet3/issues/482","id":110320419,"number":482,"title":"Enabling SSE potentially slows down performance(?)","user":{"login":"juj","id":225351,"avatar_url":"https://avatars.githubusercontent.com/u/225351?v=3","gravatar_id":"","url":"https://api.github.com/users/juj","html_url":"https://github.com/juj","followers_url":"https://api.github.com/users/juj/followers","following_url":"https://api.github.com/users/juj/following{/other_user}","gists_url":"https://api.github.com/users/juj/gists{/gist_id}","starred_url":"https://api.github.com/users/juj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juj/subscriptions","organizations_url":"https://api.github.com/users/juj/orgs","repos_url":"https://api.github.com/users/juj/repos","events_url":"https://api.github.com/users/juj/events{/privacy}","received_events_url":"https://api.github.com/users/juj/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-10-07T21:26:23Z","updated_at":"2015-10-13T17:01:02Z","closed_at":"2015-10-08T00:44:19Z","body":"I'm experimenting with the Bullet physics engine version 2.82, and comparing scalar code implementation to SSE implementation (`BT_USE_SSE` and `BT_USE_SSE_IN_API` defined). My tests are being run on a Windows Haswell system with Visual Studio 2015 compiler. The scene consists of 1500 boxes falling from the sky in six tall columns. You can find an interactive HTML5 web build of the scene here: https://dl.dropboxusercontent.com/u/40949268/emcc/2015-10-05-emunittest_0.4-PhysicsStressTest-Urho3D_1.4_e1.34.11-release-prof/12_PhysicsStressTest.html (please run in Firefox, preferably in 64-bit and in Nightly for best performance). Note that the web build is just for illustration purposes of what my scene looks like. I am not benchmarking the web build, but a native Windows 64-bit build.\r\n\r\nThe results I am getting are quite surprising: when I compile a 32-bit Windows executable with `BT_USE_SSE` and `BT_USE_SSE_IN_API` defined, I am getting roughly 10% *worse* performance compared to the scalar build. When comparing 64-bit builds, SSE is a bit faster than scalar, but only about 3% (tested one run, not much for statistical significance). I am profiling the hotspots with AMD CodeXL, and in each case, Bullet functions are consuming more than 90% of the total frametime, so the 3D engine driving the application should not be affecting the results. Looking at AMD CodeXL profiles confirms that the workload is saturated with Bullet simulation:\r\n\r\n   - scalar: https://dl.dropboxusercontent.com/u/40949268/dump/Urho3D_scalar.png\r\n   - sse: https://dl.dropboxusercontent.com/u/40949268/dump/Urho3D_sse.png\r\n\r\nIn the web build, that can be confirmed by hitting F2, and observing the times given by the internal profiler, \"StepSimulation\" is where Bullet physics is being driven.\r\n\r\nI have fixed the timesteps I pass to `stepSimulation`, calling it at a constant rate of timeStep = 0.016667, maxSubSteps=0, internalTimeStep = 0.016667.\r\n\r\nMy question is whether there exists benchmarks of Bullet's sse performance posted somewhere? Are my results to be expected?"},"comment":{"url":"https://api.github.com/repos/bulletphysics/bullet3/issues/comments/147778231","html_url":"https://github.com/bulletphysics/bullet3/issues/482#issuecomment-147778231","issue_url":"https://api.github.com/repos/bulletphysics/bullet3/issues/482","id":147778231,"user":{"login":"tamaynard","id":3449222,"avatar_url":"https://avatars.githubusercontent.com/u/3449222?v=3","gravatar_id":"","url":"https://api.github.com/users/tamaynard","html_url":"https://github.com/tamaynard","followers_url":"https://api.github.com/users/tamaynard/followers","following_url":"https://api.github.com/users/tamaynard/following{/other_user}","gists_url":"https://api.github.com/users/tamaynard/gists{/gist_id}","starred_url":"https://api.github.com/users/tamaynard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamaynard/subscriptions","organizations_url":"https://api.github.com/users/tamaynard/orgs","repos_url":"https://api.github.com/users/tamaynard/repos","events_url":"https://api.github.com/users/tamaynard/events{/privacy}","received_events_url":"https://api.github.com/users/tamaynard/received_events","type":"User","site_admin":false},"created_at":"2015-10-13T17:01:02Z","updated_at":"2015-10-13T17:01:02Z","body":"You mention AMD CodeXL. I believe running SSE on AMD was slower at some point than Intel, not sure if this is still the case or if it would explain the discrepancies you see here, but could be worth checking out if you haven't already done so."}}