php-openapi icon indicating copy to clipboard operation
php-openapi copied to clipboard

Introduce a simple cache and build a new ReferenceContext only when needed

Open marcelthole opened this issue 2 years ago • 0 comments

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) grafik

marcelthole avatar Mar 11 '22 14:03 marcelthole