)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"270bad163620edb9e27a88d8346c2eb993d4ddc2","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"* It only works for python\u003e\u003d3.5 (easy to work around)"},{"line_number":13,"context_line":"* It only writes types that are native to JSON, so sets and default"},{"line_number":14,"context_line":"  dicts need to be worked around (as seen in this change)."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"The results are useful though. A request which was taking 1.57 seconds"},{"line_number":17,"context_line":"takes 1.35s with these changes. That doesn\u0027t sound like much, but it"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7faddb67_74599f8c","line":14,"updated":"2019-08-08 11:37:10.000000000","message":"* it enforces strict json rules like json dict can only have string keys. So orjson.dumps({1: \u0027a\u0027}) will raise an exception instead of emitting {\"1\": \"a\"} json string.","commit_id":"92cc250c604d8b12e920f135fb8fe8b0ee693997"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"270bad163620edb9e27a88d8346c2eb993d4ddc2","unresolved":false,"context_lines":[{"line_number":20,"context_line":"A WIP because:"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"* we should talk about it"},{"line_number":23,"context_line":"* we\u0027d need global requirements"},{"line_number":24,"context_line":"* we\u0027d probably want to do it anywhere we dump large (for loads it would"},{"line_number":25,"context_line":"  not be much of a win)"},{"line_number":26,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7faddb67_54fee338","line":23,"updated":"2019-08-08 11:37:10.000000000","message":"What do we need to consider for a global requirements?\n* I guess licensing is one, but not a problem here, as orjson is MIT or Apache 2.0.\n* maturity: It seems this is a relatively young module. First commit is from November 2018.\n* active maintenance: There seems to be monthly releases. \n\nany other thing to consider?","commit_id":"92cc250c604d8b12e920f135fb8fe8b0ee693997"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7a9375f50e3aa7552a5b70ba7ea5af501d3a00be","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"* we should talk about it"},{"line_number":23,"context_line":"* we\u0027d need global requirements"},{"line_number":24,"context_line":"* we\u0027d probably want to do it anywhere we dump large (for loads it would"},{"line_number":25,"context_line":"  not be much of a win)"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"[1] https://pypi.org/project/orjson/"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7faddb67_c5ccb16b","line":25,"range":{"start_line":24,"start_character":2,"end_line":25,"end_character":22},"updated":"2019-08-19 22:15:41.000000000","message":"so are you saying we would be importing both things and using the old for some bits?","commit_id":"a494ba5e0593c76b3530ca74181d6fa2284db305"}],"placement/handlers/allocation_candidate.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"270bad163620edb9e27a88d8346c2eb993d4ddc2","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        for rr in ar.resource_requests:"},{"line_number":72,"context_line":"            res_dict \u003d rp_resources[rr.resource_provider.uuid][\u0027resources\u0027]"},{"line_number":73,"context_line":"            res_dict[rr.resource_class] \u003d rr.amount"},{"line_number":74,"context_line":"        result \u003d dict(allocations\u003drp_resources)"},{"line_number":75,"context_line":"        if want_version.matches((1, 34)):"},{"line_number":76,"context_line":"            result[\u0027mappings\u0027] \u003d ar.mappings"},{"line_number":77,"context_line":"        results.append(result)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_d43093a1","side":"PARENT","line":74,"range":{"start_line":74,"start_character":34,"end_line":74,"end_character":46},"updated":"2019-08-08 11:37:10.000000000","message":"Instead of removing the usage of the defaultdict you can simply convert the default dict to a normal dict:\n\n    result \u003d dict(allocations\u003ddict(rp_resources))\n\nI don\u0027t know if this will remove our performance gain by doing the extra dict conversion.","commit_id":"5883c794f969b8fda14078137704b4dd34919ab0"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"a0cd9ce9c6e50e2eceb2c4bc2e3236f421b5636a","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        for rr in ar.resource_requests:"},{"line_number":72,"context_line":"            res_dict \u003d rp_resources[rr.resource_provider.uuid][\u0027resources\u0027]"},{"line_number":73,"context_line":"            res_dict[rr.resource_class] \u003d rr.amount"},{"line_number":74,"context_line":"        result \u003d dict(allocations\u003drp_resources)"},{"line_number":75,"context_line":"        if want_version.matches((1, 34)):"},{"line_number":76,"context_line":"            result[\u0027mappings\u0027] \u003d ar.mappings"},{"line_number":77,"context_line":"        results.append(result)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_f47d8fb2","side":"PARENT","line":74,"range":{"start_line":74,"start_character":34,"end_line":74,"end_character":46},"in_reply_to":"7faddb67_d43093a1","updated":"2019-08-08 11:42:41.000000000","message":"I was trying to avoid the cast as the cost of those does seem to add up. Unclear if it is more or less than adding in a conditional.","commit_id":"5883c794f969b8fda14078137704b4dd34919ab0"}],"placement/objects/allocation_candidate.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"270bad163620edb9e27a88d8346c2eb993d4ddc2","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        self.resource_requests \u003d resource_requests or []"},{"line_number":183,"context_line":"        # mappings will be presented as a dict during output, so ensure we have"},{"line_number":184,"context_line":"        # a reasonable default here, despite mappings always being set."},{"line_number":185,"context_line":"        self.mappings \u003d dict(mappings) or dict()"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    def __repr__(self):"},{"line_number":188,"context_line":"        anchor \u003d (self.anchor_root_provider_uuid[-8:]"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_f4f02f94","line":185,"updated":"2019-08-08 11:37:10.000000000","message":"Can the \u0027mappings\u0027 be a defaultdict? I removed this explicit dict conversion and the unit and functional tests passes with python 3.6","commit_id":"92cc250c604d8b12e920f135fb8fe8b0ee693997"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"a0cd9ce9c6e50e2eceb2c4bc2e3236f421b5636a","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        self.resource_requests \u003d resource_requests or []"},{"line_number":183,"context_line":"        # mappings will be presented as a dict during output, so ensure we have"},{"line_number":184,"context_line":"        # a reasonable default here, despite mappings always being set."},{"line_number":185,"context_line":"        self.mappings \u003d dict(mappings) or dict()"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    def __repr__(self):"},{"line_number":188,"context_line":"        anchor \u003d (self.anchor_root_provider_uuid[-8:]"}],"source_content_type":"text/x-python","patch_set":2,"id":"7faddb67_9448db87","line":185,"in_reply_to":"7faddb67_f4f02f94","updated":"2019-08-08 11:42:41.000000000","message":"I remember having to do this for some reason, but perhaps I subsequently changed something else that made it not an issue. I\u0027ll investigate further if we decide that going this direction is worth it.","commit_id":"92cc250c604d8b12e920f135fb8fe8b0ee693997"}]}
