endroid / qr-code

QR Code Generator
https://endroid.nl
MIT License
4.33k stars 721 forks source link

Version 2+ really slow (xdebug) #444

Closed francoisjacquet closed 3 months ago

francoisjacquet commented 3 months ago

Hello and thank you for this great library :)

I was using until now version 1.9 to get PHP 5.5 compatibility.

But I now get deprecated errors with PHP 8.3...

So today, I have been testing versions 4.4.7 and the latest, 5.0.7.

They both are really slow compared to version 1.9, and a single PNG takes up to 3 seconds to generate, why is that?

francoisjacquet commented 3 months ago

In order to compare code for

endroid commented 3 months ago

Hi @francoisjacquet, when I run your last snippet here (exactly as you placed it) the code generates in approximataly 10ms. Of course I have different hardware here, but this difference is so big I think something else is going on, so I'm curious what is causing the performance issue on your side.

I don't know your exact url and label, can you provide those values to make sure it is not caused by specific values? Also, please check if you do not have underlying processes like xdebug running. And if it is really hard to find you could try to use a profiler like Blackfire. Such a tool makes finding the underlying cause a lot easier most of the cases.

francoisjacquet commented 3 months ago

Hello @endroid

Thank you for your answer.

I have tried without xdebug, and the difference is huge.

There is now no notable difference between v5.0.7 and v1.9 :)