I've never actually run into performance issues, neither when using it in production professionally, nor for my self-hosted sites (with Matomo always running on-prem). I'd say the performance of PHP and MySQL/MariaDB is most likely decent as long as you don't go too far into specialized workloads, for example log aggregation/tracing; though even some APM solutions like Apache Skywalking also support using traditional RDBMSes for this purpose as well: https://skywalking.apache.org/docs/main/v9.0.0/en/setup/back...
That said, I can't help but to wonder at what actual scale (number of logged events/second, given certain hardware) you'd run into issues. Luckily, because adding basic analytics is usually quite easy, testing this for your own workloads shouldn't be out of the question - then you can let the data speak for itself.