removeAnnotation performance
momala454 opened this issue · 1 comments
When using a pathfilter to remove paths, the calls to removeAnnotation are slow.
On my code, it takes around 0.3s for each call to it. I think that I have 333 endpoints
it is "traverseAnnotations" which is slow, not the detaching, as if I comment it, it still take the same time
$this->traverseAnnotations($root, function ($item) use ($remove) {
if ($item instanceof \SplObjectStorage) {
foreach ($remove as $annotation) {
//$item->detach($annotation);
}
}
});
I don't know if it can be optimised.
Generating a swagger takes 45s with a filter that remove almost all endpoints, while without filter it takes 8 seconds
edit: on my code, i can remove all code after $callable($root)
on traverseAnnotations
, because the filtered path is directly written. I'm not sure if it's necessary to parse all properties to know the path ?
Well, the tests still pass without recursion. However, removal of unused components might be affected without. Perhaps we can make the recursive part optional...