After last update my app became very slow...
From 300ms loading a webpage is went up to 14secs...
Application booting takes a lot of time and queries jump from 1-3ms to 50-70ms
And i found that the problem was debugbar...
I believe the change with commit #787 for laravel 5.6 affect version 5.5 of laravel because symphony var dumper is 3.4.4 version and not 4.x
Reverting back to 3.1.1 version fix the issue....
I am using Laravel v5.5.34 and PHP 7.1.14
I have also found slowness for myself too.
It's not a fix, but it could help narrow it down. Try disabling DB query tracking in debugbar's config - this fixed it for me.
I also confirm that the browser is getting very slow with the debugbar enabled
Disabling the gate collector fixed this issue for me (db collector seems to work fine for example).
The problem is not the db query or the gate collector.
The problem is the event collector. If you disable the event collector the application works perfectly.
I found it very slow, too. I disabled the gate collector and it came back to the usual speed.
I'm running Laravel 5.6 on php 7.2.1
Gate + Event, disable them and it'll be back to normal.
Yup, my load went from ~100ms to 800-1200ms when upgrading from 3.1.0. Reverted back to 3.1.0 fixed this for me
The issue seems to be that the VarCloner logic is much more complex than the logic that was in ValueCollector, namely it does a deep copy of the data, while ValueCollector had very shallow/simple logic.
In other words, it doesn't seem that this change is seemless in terms of performance, especially when large objects are cloned.
Also related, #785.
But the old method is not possible any more, so what is the alternative?
I'd suggest something as simple as copying the ValueExporter class to this project. I doubt that this class is likely to require any sort of maintenance.
Can you try with https://github.com/barryvdh/laravel-debugbar/commit/664fa434e26febf04d60df0368303cf0fe14f63a
That pulls in the ValueExporter logic and uses that in the gate/event/view collectors. The performance is indeed HUGE, although the method is presented as alternative.
You can test with requiring 3.2.x@dev
I've tagged a new release.
Performance is back to normal in the latest release when I enable the gate collector. Thanks!
Hey @barryvdh new version works great!
Thanks for your amazing job, i am closing the issue.
Keep walking ;)
Most helpful comment
The problem is not the db query or the gate collector.
The problem is the event collector. If you disable the event collector the application works perfectly.