Improve performance of debug mode
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3582924. -->
Reported by: [freelock](https://www.drupal.org/user/313537)
Related to !607
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Hi,</p>
<p>I'm hitting a huge performance regression between ECA 3.0.11 and 3.1.0, I think on multiple sites... I first hit this on the plane home from DrupalCon, trying to ge the form template models to show up on a local copy of my site -- I could not even load a simple contact webform at all, it kept timing out.</p>
<p>Now in our main PM system, we're getting lots of timeouts on JSONAPI calls. If I use the ECA kill switch in the settings file, performance goes back to normal. If I downgrade to 3.0.11 performance is fine - but when I re-upgrade to 3.1.0, back to really bad performance. </p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>I think it might be related to queries that load multiple entities -- things load up fine with queries that don't return much data - but on anything substantial, I'm seeing really slow page load times. Some of the jsonapi requests are taking 3.5x as long as soon as ECA is enabled, even if no model is getting invoked on a request.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Investigating still.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3 id="summary-ui-changes">User interface changes</h3>
<h3 id="summary-api-changes">API changes</h3>
<h3 id="summary-data-model-changes">Data model changes</h3>
issue