Open SOHELAHMED7 opened 3 years ago
When $openapi object is initialised by reading spec file it is taking significant time that can be reduced ($openapi = Reader::readFromJsonFile(realpath('openapi_spec.json'));)
I think result shoud be cached. Two ways:
Last approach is best practice.
Currently, I'm use parsing for build app routing powered by spec with FastRoute (https://github.com/FreeElephants/json-api-php-toolkit/blob/be6041c5f6fd586e19d3bf1ba3b3b4030e260c11/src/FreeElephants/JsonApiToolkit/Routing/FastRoute/CacheableDispatcherFactoryProxy.php for example).
First of all, Thanks for this amazing library.
I am using this library and would like to share experience that will give you data when you refactor code to improve performance
$openapi
object is initialised by reading spec file it is taking significant time that can be reduced ($openapi = Reader::readFromJsonFile(realpath('openapi_spec.json'));
)print_r
a Schema object (cebe\openapi\spec\Schema
) it takes a lot of time, browser crashes sometimes. (Workaround print_r property directlyecho $schema->title
)max_execution_time
&memory_limit
are needed to increase. If possible, changes can be made to be within limit of PHP defaultsNote: I have not done concrete profiling. This are just my primary observation while using the lib
I will share further experiences when I go come across any