Skip to main content
Participating Frequently
July 5, 2012
Answered

CF10 debugging slow performance

  • July 5, 2012
  • 2 replies
  • 3678 views

I'm working on a CF7 to CF10 migration. If I turn on debugging in CF10 I'm seeing high page rendering times of the order of 100 seconds per page. This didn't happen in CF7. The CPU goes to 100% for the duration of the request. It seems the debug rendering is the culprit.

I've traced a correlation with custom tag mappings. If I remove the mappings, the page render times become acceptable. The behaviour is the same whether the application calls custom tags or not.

What's causing the slow page loads here and is there a work around?

This topic has been closed for replies.
Correct answer Adam Cameron.

If I remove the custom tag paths...

Are these ones set in CFAdmin or in Application.cfc?

And how many mappings are there, and how many files / directories are in the directory structure you're pointing to?  Is it the same with ANY custom tag mappings, or is it just specific ones?  Like for example if you have a single mapping to C:\someEmptyDir, is the problem the same?

I'm just needing to reinstall CF10 to troubleshoot another problem, but it's almost done so will have a look at this shortly and see if I can replicate.

--

Adam


OK, I've tracked it down.

It seems expandPath() is REALLY REALLY REALLY slow if you have custom tag paths set that have a lot of files in them.

I added my scratch dir to my custom tag path (6000 files, 2000 dirs), and this caused expandPath() to take about 1.5sec per path to execute (and it's called for every template having its debug output displayed, so that could be really a lot of hits to it.  One might think that's a horrendous sized dir to have in a custom tag path, but the thing is, running the same code with the same config on CF9 causes no discernable delay at all.

So I think, Matt, you've found a serious bug in CF10 there.  This isn't just going to impact debugging, it's going to impact any code using expandPath() in conjunction with custom tag paths (not an edgecase, I think!)

YIKES

Would you like to raise a bug: https://bugbase.adobe.com/  ?  You discovered it, 'n' all.

I'm amidst some communications with one of the CF10 engineers @ the mo', so I'll bring it to his attention as soon as you post back the bug ref.

I will also say... that code in the classic.cfm debug template is HORRENDOUS.  It should be binned and rewritten by someone competent.  But that's nothing to do with this bug, it's just an observation.

--

Adam

2 replies

Inspiring
July 6, 2012

Good analysis.  Just one question: when you say it's got something to do with debug rendering, do you mean that if you have debug rendering on, it'll take (for example) that 147sec to render a page, but with debug off the page renders at an acceptable speed?

Question: are you sure it's the debug rendering, or simply the debug processing?  If you replace the debug output template (in WEB-INF/debug) with an empty file, do you still get the poor performance?  I suspect it's the capturingof the debug info that is the culprit here, not the rendering of the results.

And I'm not sure what to suggest to mitigate it, sorry.  But I am scratching my head...

--

Adam

Participating Frequently
July 6, 2012

Thanks Adam, that's really helpful. It does appear to be the rendering of the debug output that's causing the problem.

The page loads quickly with debugging turned off. Turn debugging on and the page takes more that 2 mins to load.

As you suggested, I swapped the debug template for a blank one, and the page loads quickly again.

I might have a dig around inside the debug template to see if I can isolate the part that is running slowly.

Participating Frequently
July 9, 2012

Switching off Report Execution Times in the debugger settings allows the debug page to load normally (Debugging Time: 10ms). With this setting enabled, the debugging time is reported as 214000ms for my application

Participating Frequently
July 6, 2012
Debug Rendering Time: 147333 ms