exegesis-js / exegesis

Tools for implementing server-side OpenAPI 3.0.0
MIT License
139 stars 36 forks source link

Loading is too slow due to schema compilation #496

Closed psznm closed 3 months ago

psznm commented 3 months ago

I am having issues with slow application startup which is caused by ajv.compile in this package.

I have around 100 api calls and the api loading takes me around 13 second which is 95% time of my application startup, if I exclude code-loading.

I suggest that the schemas could be compiled lazily. I believe that would be very simple to implement, and to put behind an option. If you think that is a good idea, I am willing to implement this. Please, let me know if I should work on it.

jwalton commented 3 months ago

I’d definitely welcome a PR.

psznm commented 3 months ago

I have added PR solving this issue - https://github.com/exegesis-js/exegesis/pull/497