)]}'
{"rally/plugins/openstack/scenarios/keystone/utils.py":[{"author":{"_account_id":6172,"name":"Boris Pavlovic","email":"boris@pavlovic.me","username":"boris-42"},"change_message_id":"aece73447367d3070bf758bae9d149cea63b36c5","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _resource_delete(self, resource):"},{"line_number":60,"context_line":"        \"\"\"\"Delete keystone resource.\"\"\""},{"line_number":61,"context_line":"        resource_cls_name \u003d reflection.get_class_name(resource,"},{"line_number":62,"context_line":"                                                      fully_qualified\u003dFalse)"},{"line_number":63,"context_line":"        r \u003d \"keystone.delete_%s\" % resource_cls_name.lower()"},{"line_number":64,"context_line":"        with atomic.ActionTimer(self, r):"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa69d971_72fca53e","line":61,"updated":"2016-01-08 08:35:39.000000000","message":"Sorry but I don\u0027t like this \u003d( Here is the reason: \n\nIf we take a look at the implementation of reflection.get_class_name: \nhttps://github.com/openstack/oslo.utils/blob/master/oslo_utils/reflection.py#L95-L96\n\nIt does a lot of checks, uses heavy libs like inspect and basically in our case it just executes this: \n\n  obj \u003d type(obj)\n  return obj.__name__\n\nwhich is the same what we are doing but: \n   resources.__class__.__name__\n\n\nHowever resources.__class__.__name__ doesn\u0027t call any methods, and works 11 times faster. Here is the benchmark if you don\u0027t believe: \nhttps://gist.github.com/boris-42/ed8d1572929988234709\n\n\nSo things that I don\u0027t like: \n\n  - Using more code that we actually need  (more code \u003d\u003d more bugs) \n  - In this case we make simple code complicated (changing the line that is clear for everybody) to something that requires going to another lib oslo_utils and analyzing actually the big python method. \n  - Very poor performance","commit_id":"36a8bb1c8d156fe278850cc59929aa4f1be8ad19"}]}
