Skip to main content
Inspiring
May 23, 2012
Question

ColdFusion 10 SLOW with ExpandPath()

  • May 23, 2012
  • 1 reply
  • 1789 views

We have two identical versions of our application running on the same server - one in CF9 and one in CF10.  We noticed that CF10 is signficantly slower.  To be more specific it is more that 10x slower than CF9.  So, we started experimenting with CFTIMER to narrow down the issue.  Here's what we discovered...

<cftimer>

<cfset expandpath('/') />

</cftimer>

On ColdFusion 9, this runs in 10-20ms on average.  In ColdFusion 10, it runs in 200-250ms on average. 

We use expandpath quite a bit in our applications.  So, pages that load in less than 200ms on CF9 are now loading in 10000+ milliseconds on CF10.

It doesn't matter if we change it to this...

<cftimer>

<cfset expandpath('/some/folder/path') />

</cftimer>

The result is still the same.

Note that our application does run from a UNC path because it is load balanced across multiple servers.  So, the expand path will resolve to \\server\folder\file.cfm.   As you can see, this works just fine with CF9 but CF10 can't seem to handle it.

Any thoughts on this?  Is it a CF issue or a TomCat issue?

    This topic has been closed for replies.

    1 reply

    tSparkAuthor
    Inspiring
    June 4, 2012

    I set up a test to show that this is not just our network or share setup.  It appears to be a problem with expandpath in coldfusion.

    <cffile action="read" file="\\myserver\myweb\www\robots.txt" variable="tester" />
    (Hard Coded \\\myserver\myweb\www\robots.txt cffile read): 7ms

    <cffile action="read" file="#expandpath('/robots.txt')#" variable="tester" />
    (Expand Path expandpath('/robots.txt') cffile read): 229ms

    <cfinclude template= "/robots.txt" />
    (cfinclude /robots.txt): 4ms

    It is particularly odd that the cfinclude is so fast.  It must do an expandpath internally to to find and include the file, right?  Either way, 229ms to run an expandPath() is way too long.  Even if I run only ONE expandpath in an application 229ms is a lot of overhead.

    Participant
    January 25, 2013

    This is scary. Have you opened a bug in the bug tracker perchance?

    tSparkAuthor
    Inspiring
    January 25, 2013