tag-manager
tag-manager copied to clipboard
Import is too slow
- [x] https://github.com/matomo-org/tag-manager/pull/520
- [ ] https://github.com/matomo-org/tag-manager/pull/521
- [ ] https://github.com/matomo-org/tag-manager/pull/522
- [ ]
deleteContainer*(Template) methods every time check template references causing loop in loop but EVERY template will be deleted so checking references makes no sense - [ ]
getContainer*models methods causesenrich*methods while onlyid*used. Better use dao - [ ] the best for deletion would be mass deletion to prevent n+1 queries
- [ ] providers methods
get(Tag|Trigger|Variable),checkIsValid*use loops to find template. See #532 - [ ]
accessValidator->checkUseCustomTemplatesCapabilityapplied only toidSitebut not for each template so it could be cached for loops - [ ]
Request::processRequestcauses too much duplicate and unnecessary logic such asaccessValidator->checkWriteCapability,containers->checkContainerExists,accessValidator->checkUseCustomTemplatesCapabilitythat already checked in parent controller and sanitizing-unsanitizing parameters. Maybe better use models as they contain necessary validation. #533 - [ ] Comparison
getSupportedComparisonsoutput never changes therefore should be cached as it causes 24*n translations.checkIsValidComparisoncould also use dictionary (array) instead of loop - [ ] it would be useful to have
validateValues,formatParametersmethods in models to be public to bypass duplicate*Provider->checkIsValid* - [ ] TriggerIds validator could check all triggers once to prevent n+1 queries
- [ ] Since import uses clean version duplicate template names should be checked in Import loop using dictionary (array) to prevent all
isNameInUseunnecessary queries ...