REQUEST - DEBUG: 500ms - NOT DEBUG:1500ms

When the debug is active the request speed is fast (500ms) while when the debug is not active the request takes three times (1500ms)

give a look!
VIDEO

debug

no debug

a Laravel Component is inside a Livewire componet. The laravel component has some button like this:
<button type=“button” class="w-1/{{$w}} sm:visible bg-white focus:outline-none border-2 border-gray-500 text-center py-1 text-gray-500 @click=“impostaTipoCasella(’{{$idInput}}’,’{{$sugg[0]}}’,’{{$step}}’,’{{$pattern}}’,’{{$mbind}}’)”>{{$sugg[0]}}

JS:
// funzione richiamata da row-tipo che imposta il tipo della casella di testo di input a number o testo per quando si deve inserire auto

function impostaTipoCasella(id,val,step,patt,name){
    var ev = document.createEvent('Events');
    ev.initEvent('keypress', true, true);
    ev.keyCode = 13;
    ev.which = 13;
    ev.charCode = 13;
    ev.key = 'Enter';
   ev.code = 'Enter';

   //passo comunque una stringa dal bottone dei valori suggeriti - se è testo lo ritrasformo in numero

    if(!isNaN(parseFloat(val))){val=parseFloat(val)}
    if (typeof(val)=='string'){
        document.getElementById(id).type="text";
        document.getElementById(id).pattern=patt; 
    }
    else{
        document.getElementById(id).type="number";
        document.getElementById(id).step=step;
    }
    document.getElementById(id).value=val;
    document.getElementById(id).dispatchEvent(ev);

    // emetto evento da js perchè sia ricevuto da LW e possa aggiornare la proprietà che altrimenti non è aggiornata
    window.livewire.emit('backTip',name,val);

}

then in the livewire componet there is a listener:

// listeners

    protected $listeners=['backTip'=>'setPropTip'];   // da js ho l'evento backDeltaUtc che qui ascolto e richiamo la funzione setdeltaUtc

and the finction called by the listener is:
public function setPropTip($name,$value){
$this->$name=$value;
// salvo in sessione - cookie - db la proprietà modificata
if (MyFunc::checkKeyImpasto($name)) {Management::set(‘impasto’,$name,$value);} else {Management::set(‘input’,$name,$value);}
}

1500ms is too match, I have problems chianging input quickly.
I don’t understand the reason the speed is 500ms when I activate the debug mode.

What I have to do to have always 500ms?

Laravel 7.27
Livewire 2.4.1

Marco

If I disable Xdebug the speed becomes fast. Now I’ve installed PHP 8 with jit. now the request takes about 250ms - 300ms when Xdebug is disabled in file php.ini.