{"action":"created","issue":{"url":"https://api.github.com/repos/ceph/ceph/issues/5534","labels_url":"https://api.github.com/repos/ceph/ceph/issues/5534/labels{/name}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/5534/comments","events_url":"https://api.github.com/repos/ceph/ceph/issues/5534/events","html_url":"https://github.com/ceph/ceph/pull/5534","id":100160648,"number":5534,"title":"RFC: buffer: reduce allocations","user":{"login":"liewegas","id":433031,"avatar_url":"https://avatars.githubusercontent.com/u/433031?v=3","gravatar_id":"","url":"https://api.github.com/users/liewegas","html_url":"https://github.com/liewegas","followers_url":"https://api.github.com/users/liewegas/followers","following_url":"https://api.github.com/users/liewegas/following{/other_user}","gists_url":"https://api.github.com/users/liewegas/gists{/gist_id}","starred_url":"https://api.github.com/users/liewegas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liewegas/subscriptions","organizations_url":"https://api.github.com/users/liewegas/orgs","repos_url":"https://api.github.com/users/liewegas/repos","events_url":"https://api.github.com/users/liewegas/events{/privacy}","received_events_url":"https://api.github.com/users/liewegas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ceph/ceph/labels/core","name":"core","color":"0052cc"},{"url":"https://api.github.com/repos/ceph/ceph/labels/performance","name":"performance","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-10T20:22:34Z","updated_at":"2015-08-14T08:08:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/5534","html_url":"https://github.com/ceph/ceph/pull/5534","diff_url":"https://github.com/ceph/ceph/pull/5534.diff","patch_url":"https://github.com/ceph/ceph/pull/5534.patch"},"body":"The first patch combines the 'raw' (refcount) and actual data buffer into 1 allocation.  That takes us from\r\n\r\n[ RUN      ] Buffer.BenchAlloc\r\n1000000 alloc of size 32 in 0.306848\r\n1000000 alloc of size 4096 in 0.363294\r\n1000000 alloc of size 16384 in 0.360565\r\n[       OK ] Buffer.BenchAlloc (1031 ms)\r\n\r\nto\r\n\r\n[ RUN      ] Buffer.BenchAlloc\r\n1000000 alloc of size 32 in 0.286422\r\n1000000 alloc of size 4096 in 0.313642\r\n1000000 alloc of size 16384 in 0.309992\r\n[       OK ] Buffer.BenchAlloc (911 ms)\r\n\r\nThe rest of the patches change bufferlist to be an intrusive list (no real change in performance), and then embed ptr's in raw... ultimately taking us from 3 allocations to 1.  For the bufferlist append test, overall we go from\r\n\r\n[ RUN      ] BufferList.BenchAlloc\r\n100000 alloc of size 32 in 0.651433\r\n100000 alloc of size 4096 in 0.799733\r\n100000 alloc of size 16384 in 0.789603\r\n[       OK ] BufferList.BenchAlloc (2241 ms)\r\n\r\nto\r\n\r\n[ RUN      ] BufferList.BenchAlloc\r\n100000 alloc of size 32 in 0.305846\r\n100000 alloc of size 4096 in 0.351239\r\n100000 alloc of size 16384 in 1.664326\r\n[       OK ] BufferList.BenchAlloc (2322 ms)\r\n\r\nThe 16k result is very strange... it seem sto be allocator dependent. For example, if I revert teh first change (so we still have a separate raw allocation, but are doing the intrusive bufferlist) I can get\r\n\r\n[ RUN      ] Buffer.BenchAlloc\r\n1000000 alloc of size 32 in 0.319626\r\n1000000 alloc of size 4096 in 0.386397\r\n1000000 alloc of size 16384 in 0.326450\r\n[       OK ] Buffer.BenchAlloc (1032 ms)\r\n[----------] 1 test from Buffer (1032 ms total)\r\n\r\n[----------] 1 test from BufferList\r\n[ RUN      ] BufferList.BenchAlloc\r\n100000 alloc of size 32 in 0.342013\r\n100000 alloc of size 4096 in 0.477699\r\n100000 alloc of size 16384 in 0.481672\r\n[       OK ] BufferList.BenchAlloc (1301 ms)\r\n\r\nif I run both tests, but if I run *just* the bufferlist one, I get\r\n\r\n[ RUN      ] BufferList.BenchAlloc\r\n100000 alloc of size 32 in 0.323774\r\n100000 alloc of size 4096 in 0.350287\r\n100000 alloc of size 16384 in 1.665775\r\n[       OK ] BufferList.BenchAlloc (2340 ms)\r\n\r\nSo, clearly there are some secondary effects with the allocator.  This will need some more thorough benchmarking than what I've done :)."},"comment":{"url":"https://api.github.com/repos/ceph/ceph/issues/comments/131013216","html_url":"https://github.com/ceph/ceph/pull/5534#issuecomment-131013216","issue_url":"https://api.github.com/repos/ceph/ceph/issues/5534","id":131013216,"user":{"login":"loic-bot","id":9638672,"avatar_url":"https://avatars.githubusercontent.com/u/9638672?v=3","gravatar_id":"","url":"https://api.github.com/users/loic-bot","html_url":"https://github.com/loic-bot","followers_url":"https://api.github.com/users/loic-bot/followers","following_url":"https://api.github.com/users/loic-bot/following{/other_user}","gists_url":"https://api.github.com/users/loic-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/loic-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loic-bot/subscriptions","organizations_url":"https://api.github.com/users/loic-bot/orgs","repos_url":"https://api.github.com/users/loic-bot/repos","events_url":"https://api.github.com/users/loic-bot/events{/privacy}","received_events_url":"https://api.github.com/users/loic-bot/received_events","type":"User","site_admin":false},"created_at":"2015-08-14T08:08:20Z","updated_at":"2015-08-14T08:08:20Z","body":"SUCCESS: http://jenkins.ceph.dachary.org/job/ceph/7053/\n* SUCCESS http://jenkins.ceph.dachary.org/job/ceph/LABELS=centos-7&&x86_64/7053/\n* SUCCESS http://jenkins.ceph.dachary.org/job/ceph/LABELS=ubuntu-14.04&&x86_64/7053/\n"}}