Skip to content

Use a parsed schema in the cached decoder function #518

Closed
@0x26res

Description

@0x26res

Description

MessageSerializer#_get_decoder_func should call fastavro#parse_schema to improve performance.

There is a minor overhead to this function call (parse_schema), so it would be beneficial if it was only done once, and the parsed schema would be binded to schemaless_reader when creating the lambda that constitutes the cached decoder function

Later, the call to parse_schema within schemaless_reader is smart enough to figure out that the schema is already parsed (https://github.com/fastavro/fastavro/blob/master/fastavro/_schema_py.py#L83)

How to reproduce

I'm not sure if it's applicable as it is not a bug. This is covered by TestMessageSerializer either.

Checklist

Please provide the following information:

  • confluent-kafka-python and librdkafka version (confluent_kafka.version() and confluent_kafka.libversion()): 0.11.4
  • Apache Kafka broker version: 0.11.0.3
  • [ ] Client configuration: {...}
  • Operating system: Linux
  • Provide client logs (with 'debug': '..' as necessary)
  • Provide broker log excerpts
  • Critical issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions