)]}'
{"id":"openstack%2Fplacement~674239","triplet_id":"openstack%2Fplacement~master~I4acb16d13976d64d47f798ebbec626a73b79b4f5","project":"openstack/placement","branch":"master","topic":"cd/de-tuple","hashtags":[],"change_id":"I4acb16d13976d64d47f798ebbec626a73b79b4f5","subject":"Use __slots__ in commonly used objects","status":"MERGED","created":"2019-08-02 09:29:01.000000000","updated":"2019-08-02 17:38:43.000000000","submitted":"2019-08-02 17:38:43.000000000","submitter":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"total_comment_count":9,"unresolved_comment_count":0,"has_review_started":true,"submission_id":"674239-1564767523469-682773cd","meta_rev_id":"9595709205caea8132b16e2c29de292cb8cbc378","_number":674239,"virtual_id_number":674239,"owner":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"actions":{},"labels":{"Verified":{"approved":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"all":[{"value":0,"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},{"value":0,"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},{"value":0,"date":"2019-08-02 15:30:53.000000000","_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"value":2,"date":"2019-08-02 17:38:43.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{"-2":"Fails","-1":"Doesn\u0027t seem to work"," 0":"No score","+1":"Works for me","+2":"Verified"},"description":"","default_value":0,"optional":true},"Code-Review":{"approved":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"all":[{"value":2,"date":"2019-08-02 15:25:25.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},{"value":2,"date":"2019-08-02 14:18:33.000000000","_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},{"value":0,"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"value":0,"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{"-2":"Do not merge","-1":"This patch needs further work before it can be merged"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me (core reviewer)"},"description":"","default_value":0,"optional":true},"Workflow":{"approved":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"all":[{"value":1,"date":"2019-08-02 15:25:25.000000000","permitted_voting_range":{"min":1,"max":1},"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},{"value":0,"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},{"value":0,"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"value":0,"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{"-1":"Work in progress"," 0":"Ready for reviews","+1":"Approved"},"description":"","default_value":0,"optional":true},"Review-Priority":{"all":[{"value":0,"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},{"value":0,"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},{"value":0,"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"value":0,"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}],"values":{" 0":"Default Priority","+1":"Contributor Review Promise","+2":"Core Review Promise"},"description":"","default_value":0,"optional":true}},"removable_reviewers":[],"reviewers":{"REVIEWER":[{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2019-08-02 13:33:10.000000000","updated_by":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"reviewer":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"state":"REVIEWER"},{"updated":"2019-08-02 15:25:25.000000000","updated_by":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"reviewer":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"state":"REVIEWER"},{"updated":"2019-08-02 17:38:43.000000000","updated_by":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"reviewer":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"state":"REVIEWER"}],"messages":[{"id":"379fa9d6ab353b996a97a879c3a1f89224efae7d","author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"date":"2019-08-02 09:29:01.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"63dab6bf1d1e87c2c7da651f77535594c69ca5ce","author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"date":"2019-08-02 09:36:54.000000000","message":"Patch Set 1:\n\n(1 comment)","accounts_in_message":[],"_revision_number":1},{"id":"9d5e1e733cff265f585381d98931e11f94acda23","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-08-02 10:56:49.000000000","message":"Patch Set 1: Verified+1\n\nBuild succeeded (check pipeline).\n\n- grenade-py3 https://logs.opendev.org/39/674239/1/check/grenade-py3/ba6a80f/ : SUCCESS in 1h 00m 30s\n- tempest-integrated-placement https://logs.opendev.org/39/674239/1/check/tempest-integrated-placement/b7dd4e6/ : SUCCESS in 1h 17m 42s\n- openstack-tox-docs https://logs.opendev.org/39/674239/1/check/openstack-tox-docs/5981f02/html/ : SUCCESS in 5m 31s\n- openstack-tox-cover https://logs.opendev.org/39/674239/1/check/openstack-tox-cover/7487a0b/cover/ : SUCCESS in 6m 06s\n- openstack-tox-lower-constraints https://logs.opendev.org/39/674239/1/check/openstack-tox-lower-constraints/274f267/ : SUCCESS in 5m 16s\n- openstack-tox-pep8 https://logs.opendev.org/39/674239/1/check/openstack-tox-pep8/7558a2d/ : SUCCESS in 4m 32s\n- openstack-tox-py27 https://logs.opendev.org/39/674239/1/check/openstack-tox-py27/7b8d9c9/ : SUCCESS in 4m 51s\n- openstack-tox-py36 https://logs.opendev.org/39/674239/1/check/openstack-tox-py36/3a2f8d8/ : SUCCESS in 5m 12s\n- openstack-tox-py37 https://logs.opendev.org/39/674239/1/check/openstack-tox-py37/c096b19/ : SUCCESS in 6m 09s\n- openstack-tox-functional https://logs.opendev.org/39/674239/1/check/openstack-tox-functional/4e81175/ : SUCCESS in 5m 18s\n- openstack-tox-functional-py36 https://logs.opendev.org/39/674239/1/check/openstack-tox-functional-py36/41751ff/ : SUCCESS in 4m 54s\n- openstack-tox-functional-py37 https://logs.opendev.org/39/674239/1/check/openstack-tox-functional-py37/72688ce/ : SUCCESS in 5m 57s\n- placement-nova-tox-functional-py37 https://logs.opendev.org/39/674239/1/check/placement-nova-tox-functional-py37/e2d0665/ : SUCCESS in 13m 14s\n- placement-nested-perfload https://logs.opendev.org/39/674239/1/check/placement-nested-perfload/57e8ee4/ : SUCCESS in 16m 47s (non-voting)\n- placement-perfload https://logs.opendev.org/39/674239/1/check/placement-perfload/1a27474/ : SUCCESS in 9m 29s (non-voting)\n- tempest-ipv6-only https://logs.opendev.org/39/674239/1/check/tempest-ipv6-only/aef3fb0/ : SUCCESS in 1h 07m 40s","accounts_in_message":[],"_revision_number":1},{"id":"d74b99538341c11fdb87e77f54727c21898635e3","author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"date":"2019-08-02 13:33:10.000000000","message":"Patch Set 1: Code-Review+2\n\n(1 comment)\n\nThis looks OK to me. __slots__ is something I heard about when I heard Heat improved performance quite a bit by using it awhile back. I\u0027ve often wondered if nova could benefit - I\u0027m sure it could, at least for things like the HostState object in the scheduler which wraps a ComputeNode versioned object. I\u0027m less sure about whether or not slots would help versioned objects since they internalize their fields and such, but anyway I\u0027m just musing. Cool if this makes things faster since it\u0027s simple.","accounts_in_message":[],"_revision_number":1},{"id":"2e409dd0212416cb68d78ced19414c3c8f0c38c4","author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"date":"2019-08-02 13:34:45.000000000","message":"Patch Set 1:\n\nRandom question but do you have a blog post or anything about how you are comparing CPU cost before and after this change for profiling? I know you have posted a few blogs about performance and scale testing. Unfortunately I don\u0027t know if those would translate to doing similar kind of profiling on something like the nova-scheduler if I changed HostState to use slots.","accounts_in_message":[],"_revision_number":1},{"id":"d2b04cdf387d9ab27ec3d11bb5ed6445da8ee073","author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"date":"2019-08-02 14:18:33.000000000","message":"Uploaded patch set 2: Patch Set 1 was rebased.","accounts_in_message":[],"_revision_number":2},{"id":"f17e70e56aa5d8a59d80ffb3afaf1458dd4561d7","author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"date":"2019-08-02 14:42:32.000000000","message":"Patch Set 2:\n\n\u003e Random question but do you have a blog post or anything about how\n \u003e you are comparing CPU cost before and after this change for\n \u003e profiling? I know you have posted a few blogs about performance and\n \u003e scale testing. Unfortunately I don\u0027t know if those would translate\n \u003e to doing similar kind of profiling on something like the\n \u003e nova-scheduler if I changed HostState to use slots.\n\nIf the area of inspection was HostState, then I think what we\u0027d probably need to do is instrument the host manager to listen a signal, when it heard that signal it would start profiling itself (using cProfile [1] ). When it heard the signal again, it would stop. That is, there needs to be some way to not be overwhelmed by data. The stuff in placement does it per web request, dumping the prof data to a file identified by a timestamp and the URL.\n\nWhat I use to compare cpu usage is navigating around in the prof with snakeviz [2] and simply comparing numbers and vague things like \"the size of the circles\".\n\nWhereas osprofiler would allow you to see how much time is spent in particulal interactions which have been previously labelled by osprofiler as traceable, using cProfiler counts up and times every python function or method call, which can lead you to a particular method that seems more expensive than it should (for example provider_ids_from_rp_ids).\n\n[1] https://docs.python.org/3/library/profile.html\n[2] https://pypi.org/project/snakeviz/","accounts_in_message":[],"_revision_number":2},{"id":"3d5ab134daa302344780e02b7af2eb0ed15fbeed","author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"date":"2019-08-02 15:25:25.000000000","message":"Patch Set 2: Code-Review+2 Workflow+1\n\n(4 comments)\n\nThis is the same as PS1 where Matt was +2. Fast approving.","accounts_in_message":[],"_revision_number":2},{"id":"2993aabb68717b4e2f821197393e0477525d0252","author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"date":"2019-08-02 15:30:53.000000000","message":"Patch Set 2:\n\n(1 comment)\n\nBased on reviewing some of the recent test data it\u0027s looking like this change is going to have the single largest impact, but with the addition of the summaries_by_id cache, that impact will be less visible once everything is merged.","accounts_in_message":[],"_revision_number":2},{"id":"f630bcb3ba5adcb88cf382742cb0e0ff0fb8ad47","author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"date":"2019-08-02 15:43:11.000000000","message":"Patch Set 2:\n\n(1 comment)","accounts_in_message":[],"_revision_number":2},{"id":"ed79a15b04fb198459d2fe7d2c6e7965a4dc2bab","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-08-02 15:48:04.000000000","message":"Patch Set 2: Verified+1\n\nBuild succeeded (check pipeline).\n\n- grenade-py3 https://logs.opendev.org/39/674239/2/check/grenade-py3/7c12fe9/ : SUCCESS in 1h 05m 00s\n- tempest-integrated-placement https://logs.opendev.org/39/674239/2/check/tempest-integrated-placement/7551066/ : SUCCESS in 1h 23m 47s\n- openstack-tox-docs https://logs.opendev.org/39/674239/2/check/openstack-tox-docs/acd0959/html/ : SUCCESS in 5m 06s\n- openstack-tox-cover https://logs.opendev.org/39/674239/2/check/openstack-tox-cover/462614a/cover/ : SUCCESS in 5m 11s\n- openstack-tox-lower-constraints https://logs.opendev.org/39/674239/2/check/openstack-tox-lower-constraints/fb39ff3/ : SUCCESS in 4m 58s\n- openstack-tox-pep8 https://logs.opendev.org/39/674239/2/check/openstack-tox-pep8/53972e1/ : SUCCESS in 4m 24s\n- openstack-tox-py27 https://logs.opendev.org/39/674239/2/check/openstack-tox-py27/1b454d5/ : SUCCESS in 6m 20s\n- openstack-tox-py36 https://logs.opendev.org/39/674239/2/check/openstack-tox-py36/a19f92c/ : SUCCESS in 5m 18s\n- openstack-tox-py37 https://logs.opendev.org/39/674239/2/check/openstack-tox-py37/8f2c88c/ : SUCCESS in 5m 01s\n- openstack-tox-functional https://logs.opendev.org/39/674239/2/check/openstack-tox-functional/20399b7/ : SUCCESS in 5m 14s\n- openstack-tox-functional-py36 https://logs.opendev.org/39/674239/2/check/openstack-tox-functional-py36/fdd1ebd/ : SUCCESS in 4m 58s\n- openstack-tox-functional-py37 https://logs.opendev.org/39/674239/2/check/openstack-tox-functional-py37/ce06efb/ : SUCCESS in 6m 40s\n- placement-nova-tox-functional-py37 https://logs.opendev.org/39/674239/2/check/placement-nova-tox-functional-py37/d3b397e/ : SUCCESS in 13m 32s\n- placement-nested-perfload https://logs.opendev.org/39/674239/2/check/placement-nested-perfload/44c1991/ : SUCCESS in 18m 20s (non-voting)\n- placement-perfload https://logs.opendev.org/39/674239/2/check/placement-perfload/5d2f039/ : SUCCESS in 7m 36s (non-voting)\n- tempest-ipv6-only https://logs.opendev.org/39/674239/2/check/tempest-ipv6-only/c14109f/ : SUCCESS in 1h 06m 50s","accounts_in_message":[],"_revision_number":2},{"id":"4d49df430b1af306ecd19a079a885e8c14af4d82","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-08-02 15:48:27.000000000","message":"Patch Set 2: -Verified\n\nStarting gate jobs.","accounts_in_message":[],"_revision_number":2},{"id":"1f1cd135d03c3735195a7ae6584969643062c0c1","author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"date":"2019-08-02 16:32:40.000000000","message":"Patch Set 2:\n\n(1 comment)","accounts_in_message":[],"_revision_number":2},{"id":"d05312cc83ee44035e18180c4ace0b15d82d36f7","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-08-02 17:38:43.000000000","message":"Patch Set 2: Verified+2\n\nBuild succeeded (gate pipeline).\n\n- grenade-py3 https://logs.opendev.org/39/674239/2/gate/grenade-py3/4771063/ : SUCCESS in 1h 03m 12s\n- tempest-integrated-placement https://logs.opendev.org/39/674239/2/gate/tempest-integrated-placement/5124147/ : SUCCESS in 1h 23m 37s\n- openstack-tox-docs https://logs.opendev.org/39/674239/2/gate/openstack-tox-docs/551d7c0/html/ : SUCCESS in 3m 45s\n- openstack-tox-lower-constraints https://logs.opendev.org/39/674239/2/gate/openstack-tox-lower-constraints/07051d3/ : SUCCESS in 4m 59s\n- openstack-tox-pep8 https://logs.opendev.org/39/674239/2/gate/openstack-tox-pep8/f46c0bb/ : SUCCESS in 4m 30s\n- openstack-tox-py27 https://logs.opendev.org/39/674239/2/gate/openstack-tox-py27/9efd76c/ : SUCCESS in 5m 30s\n- openstack-tox-py36 https://logs.opendev.org/39/674239/2/gate/openstack-tox-py36/ebeea52/ : SUCCESS in 4m 12s\n- openstack-tox-py37 https://logs.opendev.org/39/674239/2/gate/openstack-tox-py37/b5e744d/ : SUCCESS in 5m 36s\n- openstack-tox-functional https://logs.opendev.org/39/674239/2/gate/openstack-tox-functional/8b94d04/ : SUCCESS in 5m 52s\n- openstack-tox-functional-py36 https://logs.opendev.org/39/674239/2/gate/openstack-tox-functional-py36/afa3d62/ : SUCCESS in 7m 55s\n- openstack-tox-functional-py37 https://logs.opendev.org/39/674239/2/gate/openstack-tox-functional-py37/3fc305c/ : SUCCESS in 6m 34s\n- placement-nova-tox-functional-py37 https://logs.opendev.org/39/674239/2/gate/placement-nova-tox-functional-py37/cfa63c8/ : SUCCESS in 12m 00s\n- tempest-ipv6-only https://logs.opendev.org/39/674239/2/gate/tempest-ipv6-only/3e89b41/ : SUCCESS in 1h 04m 08s","accounts_in_message":[],"_revision_number":2},{"id":"69f4a54d1ea0d12608baf5d96b6f6cce9795be36","author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"date":"2019-08-02 17:38:43.000000000","message":"Change has been successfully merged by Zuul","accounts_in_message":[],"_revision_number":2}],"current_revision_number":2,"current_revision":"5d3243f4b923ca27bcbaa0919498498337046470","revisions":{"9914ce8a9dc8eac980f53ceacaa94ed089220cfb":{"kind":"REWORK","_number":1,"created":"2019-08-02 09:29:01.000000000","uploader":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"ref":"refs/changes/39/674239/1","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/placement","ref":"refs/changes/39/674239/1","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/placement refs/changes/39/674239/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/placement refs/changes/39/674239/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/placement refs/changes/39/674239/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/placement refs/changes/39/674239/1"}}},"commit":{"parents":[{"commit":"6ee6f610f07ebf82ee5844d3e0327dc3fd823221","subject":"Use expanding bindparam in provider_ids_from_rp_ids in_","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/6ee6f610f07ebf82ee5844d3e0327dc3fd823221"}]}],"author":{"name":"Chris Dent","email":"cdent@anticdent.org","date":"2019-08-02 09:16:22.000000000","tz":60},"committer":{"name":"Chris Dent","email":"cdent@anticdent.org","date":"2019-08-02 09:16:22.000000000","tz":60},"subject":"Use __slots__ in commonly used objects","message":"Use __slots__ in commonly used objects\n\nWhen making a nested provider GET /allocation_candidates request\nthat returns around 6500 providers in the providers summary section,\nwe make ~22000 ResourceProvider and ProviderSummary objects, 7500\nAllocationRequest objects and 30000 ProviderSummaryResource objects.\n\nIn aggregate, creating and accessing these objects contributes a\nmeasurable cpu time cost. Using __slots__ [1] can speed up attribute\naccess (I measured it, it does), so lets use it for the common\nobjects. There\u0027s no evidence (yet) of other objects being an issue\nso we won\u0027t do this wholesale.\n\nA unit test is updated to change a mock from a public ResourceProvider\nmethod (set_aggregates) to a private function (_set_aggregates)\nbecause one of the limitations of __slots__ is it makes the\nslotted objects difficult to mock. In this case the test is still\ntesting the same thing.\n\nSubsequent patches will explore why we need 22000 ProviderSummary\nobjects when we\u0027re only producing 6500 resulting summaries to see\nif there is a cleanup that can be done there.\n\n[1] https://docs.python.org/3/reference/datamodel.html#slots\n\nChange-Id: I4acb16d13976d64d47f798ebbec626a73b79b4f5\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/9914ce8a9dc8eac980f53ceacaa94ed089220cfb"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/9914ce8a9dc8eac980f53ceacaa94ed089220cfb"}]},"branch":"refs/heads/master"},"5d3243f4b923ca27bcbaa0919498498337046470":{"kind":"TRIVIAL_REBASE","_number":2,"created":"2019-08-02 14:18:33.000000000","uploader":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"ref":"refs/changes/39/674239/2","fetch":{"anonymous http":{"url":"https://review.opendev.org/openstack/placement","ref":"refs/changes/39/674239/2","commands":{"Checkout":"git fetch https://review.opendev.org/openstack/placement refs/changes/39/674239/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.opendev.org/openstack/placement refs/changes/39/674239/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.opendev.org/openstack/placement refs/changes/39/674239/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.opendev.org/openstack/placement refs/changes/39/674239/2"}}},"commit":{"parents":[{"commit":"835081ac363a122153323df26c173ddee305801c","subject":"Blacklist sphinx 2.1.0 (autodoc bug)","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/835081ac363a122153323df26c173ddee305801c"}]}],"author":{"name":"Chris Dent","email":"cdent@anticdent.org","date":"2019-08-02 09:16:22.000000000","tz":60},"committer":{"name":"Chris Dent","email":"cdent@anticdent.org","date":"2019-08-02 14:17:58.000000000","tz":60},"subject":"Use __slots__ in commonly used objects","message":"Use __slots__ in commonly used objects\n\nWhen making a nested provider GET /allocation_candidates request\nthat returns around 6500 providers in the providers summary section,\nwe make ~22000 ResourceProvider and ProviderSummary objects, 7500\nAllocationRequest objects and 30000 ProviderSummaryResource objects.\n\nIn aggregate, creating and accessing these objects contributes a\nmeasurable cpu time cost. Using __slots__ [1] can speed up attribute\naccess (I measured it, it does), so lets use it for the common\nobjects. There\u0027s no evidence (yet) of other objects being an issue\nso we won\u0027t do this wholesale.\n\nA unit test is updated to change a mock from a public ResourceProvider\nmethod (set_aggregates) to a private function (_set_aggregates)\nbecause one of the limitations of __slots__ is it makes the\nslotted objects difficult to mock. In this case the test is still\ntesting the same thing.\n\nSubsequent patches will explore why we need 22000 ProviderSummary\nobjects when we\u0027re only producing 6500 resulting summaries to see\nif there is a cleanup that can be done there.\n\n[1] https://docs.python.org/3/reference/datamodel.html#slots\n\nChange-Id: I4acb16d13976d64d47f798ebbec626a73b79b4f5\n","web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/5d3243f4b923ca27bcbaa0919498498337046470"}],"resolve_conflicts_web_links":[{"name":"gitea","tooltip":"Open in GitWeb","url":"https://opendev.org/openstack/placement/commit/5d3243f4b923ca27bcbaa0919498498337046470"}]},"branch":"refs/heads/master"}},"requirements":[],"submit_records":[],"submit_requirements":[]}
