php-openapi
php-openapi copied to clipboard
Introduce a simple cache and build a new ReferenceContext only when needed
hey, maybe this could work and improve the perfomance for the use case in #156.
Here is a simple repo script:
<?php
require 'vendor/autoload.php';
$start = hrtime(true);
$openapi = \cebe\openapi\Reader::readFromYamlFile(__DIR__ . '/index.yaml');
$end = hrtime(true);
var_dump(number_format(($end - $start) / 1e6,4, ',', ' ') . ' ms');
and this are the before and after results
(left after the change, right before)