ColdBox 6.9.0+9: Slow renderLayout and renderView times

I have a layout that is used throughout my app, average load time for this renderLayout is around 30ms and renderView is around 13ms.

I have a newly created module-view using the same layout, but the renderLayout and renderView is taking approx 25 seconds to execute.

Any low hanging fruit of possible things I can check that might be causing this?

If you aren’t already using it, make sure you are using CBDebugger. It has helped me track down many similar issues.

If it does not quickly make clear out what is causing the slow the request you can also try:

  • Add some tracers to the request CB Debugger Tracers
  • Add a few timers around each possible slow running process to try and narrow down what function is slowing the request and review them in the CBDebugger console.

I can’t quickly find the documentation for timer@cbdebugger. Here is a quick recap of how I have used it:

inject the timer into the handler, model, entity, etc.

property name="debugTimer" 	inject="timer@cbdebugger";

Start and Stop the timer before and after suspect code

// Start the timer
debugTimer.start( "[Unique Timer Label Name Here]" );

/**** Existing Code/Function/Process/etc. ****/

// Stop the timer (must use exact same label used to start the timer)
debugTimer.stop( "[Unique Timer Label Name Here]" );

I can’t emphasise enough how often CBDebugger has made debugging quick and easy!

I do have cbDebugger installed and I will try your suggestion. Thanks.

1 Like

@gknight Check that you layoutParentLookup and viewParentLookup settings for the module are set to false. Those will check upwards of the module’s home for matching layouts and views.

25 seconds, though, does seem a crazy amount of time so the debugger might be necessary to determine what is taking so much time.

FusionReactor should be able to show you exactly what is going on in a matter of seconds. Either by pulling stack traces while the page is loading, or using the Profiler feature after the page has run.

Thanks for the tip, I will try this.

Working with Fusion Reactor support at moment, something wrong with my license key.

1 Like

Found the culprit, I was looping over the CF function isImageFile() (about 1,500 db results) with online images. I don’t even remember writing the code. :face_with_raised_eyebrow:

Thanks for the help everyone.

1 Like