kenhuuu commented on code in PR #3493:
URL: https://github.com/apache/tinkerpop/pull/3493#discussion_r3500346079
##########
gremlin-python/src/main/python/gremlin_python/structure/io/graphbinaryV4.py:
##########
@@ -149,6 +152,9 @@ def __init__(self, deserializer_map=None,
pdt_registry=None):
if deserializer_map:
self.deserializers.update(deserializer_map)
self.pdt_registry = pdt_registry
+ # Mirror of self.deserializers keyed by int type code instead of
DataType.
+ # Avoids the per-read DataType(bt) call, whose aenum construction
negatively affects performance on large results.
+ self._objectify_by_code = {dt.value: des.objectify for dt, des in
self.deserializers.items()}
Review Comment:
Nit: `_objectify_by_code` naming was hard for me to understand. Without
reading through the entire implementation, I couldn't tell this was a typecode
to deserialization function dispatch table. Maybe that could be clearer in the
name? Something like `code_to_objectify_function` or
`objectify_function_dispatch_table`? This is really small so if you feel like
it doesn't need to be changed then don't change it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]