Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_spec() method taking too much time #216

Closed
sarangsbabu367 opened this issue Mar 10, 2020 · 6 comments
Closed

create_spec() method taking too much time #216

sarangsbabu367 opened this issue Mar 10, 2020 · 6 comments

Comments

@sarangsbabu367
Copy link

sarangsbabu367 commented Mar 10, 2020

I am building a large product and in this stage i have an openapi-spec file with 28000 lines.
Now i have,

  • 53 path objects.

  • 14 schema objects.

openapi-core's create_spec() method is taking around 29 to 34 seconds. So my server is taking this much time to startup. Is there a remedy for this situation or is this the behaviour of openapi-core's validation ??
ps: So many Dereferencing log is present.

@p1c2u
Copy link
Collaborator

p1c2u commented Mar 11, 2020

Hi @sarangsbabu367

I didn't have chance to take closer look at performance topic. Dereferencing suggests you have many references in the spec file Is it correct?

Can you profile create_spec function and show the results?

@sarangsbabu367
Copy link
Author

@p1c2u
image

@sarangsbabu367
Copy link
Author

It is taking almost 30 secs for validating the schema.

@p1c2u
Copy link
Collaborator

p1c2u commented Mar 16, 2020

Can you upload the file so I can see more details?

@sarangsbabu367
Copy link
Author

Can you upload the file so I can see more details?

openapi_core_profile.txt

@sarangsbabu367
Copy link
Author

@p1c2u The real problem is with loggers in openapi-core. When i disabled these,

logging.getLogger("openapi_spec_validator.decorators").setLevel(logging.ERROR)
logging.getLogger("openapi_spec_validator").setLevel(logging.ERROR)
logging.getLogger("openapi_spec_validator.generators").setLevel(logging.ERROR)
logging.getLogger("openapi_spec_validator.validators").setLevel(logging.ERROR)

My server starting reduced by 50seconds. I think it will be helpfull to people if you describe this logging problem somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants