)]}'
{"marconiclient/transport/api.py":[{"author":{"_account_id":6944,"name":"Allele Dev","email":"cpp.cabrera@gmail.com","username":"cpp-cabrera"},"change_message_id":"8e452dd145c111773c4140aebf4f56b7d87ed5c9","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        if operation not in self.validators:"},{"line_number":47,"context_line":"            try:"},{"line_number":48,"context_line":"                schema \u003d self.schema[operation]"},{"line_number":49,"context_line":"                self.validators[operation] \u003d validators.Draft4Validator(schema)"},{"line_number":50,"context_line":"            except KeyError:"},{"line_number":51,"context_line":"                # TODO(flaper87): gettext support"},{"line_number":52,"context_line":"                msg \u003d \u0027{0} is not a valid operation\u0027.format(operation)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAS3%2F%2FGGs%3D","line":49,"updated":"2013-10-04 14:04:59.000000000","message":"My testing showed that the most expensive step for jsonschema is instantiating a Validator. Is there some way you could preload the validators based on the set of allowed operations?\n\nref: https://gist.github.com/cabrera/6781406","commit_id":"d4bec7fac2fdb47608a1d0d2025d1bf415f6c331"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"66bc1f7f0ebef957d876b50a5f9f157f34665a73","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        if operation not in self.validators:"},{"line_number":47,"context_line":"            try:"},{"line_number":48,"context_line":"                schema \u003d self.schema[operation]"},{"line_number":49,"context_line":"                self.validators[operation] \u003d validators.Draft4Validator(schema)"},{"line_number":50,"context_line":"            except KeyError:"},{"line_number":51,"context_line":"                # TODO(flaper87): gettext support"},{"line_number":52,"context_line":"                msg \u003d \u0027{0} is not a valid operation\u0027.format(operation)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAS3%2F%2FGAg%3D","line":49,"in_reply_to":"AAAAS3%2F%2FGGs%3D","updated":"2013-10-04 14:39:16.000000000","message":"I didn\u0027t do the perf test but I thought this operation was very expensive. I can\u0027t know what operations are allowed in advance since it all depends on the API definition - you\u0027ll see that in the upcoming patches - however, I\u0027m \"caching\" the validator in self.validator which will be valid not just for the current instance but all future instances since it\u0027s a class attribute.","commit_id":"d4bec7fac2fdb47608a1d0d2025d1bf415f6c331"}]}
