Skip to content

get_validator takes too much time #289

Closed
@sjiekak

Description

@sjiekak

I benchmarked a validation against a json input of roughly 700k characters, and it seems deepcopy of the checker is the costliest operation

snakeviz performance validate

get_validator relies on _get_format_checker

    def _get_format_checker(self):
        fc = deepcopy(oas30_format_checker)
        for name, formatter in self.custom_formatters.items():
            fc.checks(name)(formatter.validate)
        return fc

The deepcopy of oas30_format_checker is where most of the time is spent. Can you help me understand why there is a need for deepcopy ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/unmarshallingIndicates an issue on unmarshalling area.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions