Performance Issues Related to BuildURLToModule

12 views
Skip to first unread message

bclingan

unread,
Nov 4, 2013, 10:22:14 AM11/4/13
to mach-ii-for...@googlegroups.com
I have an application and have noticed that my page load time increases dramatically,  averaging about 2.8 seconds page load time versus 0.3 when BuildURLToModule() is used versus just writing my own links.

Are there any performance issues or best practices related to BuildURLToModule() that folks are aware of?

Thanks.

--Bob

Peter J. Farrell

unread,
Nov 4, 2013, 2:17:26 PM11/4/13
to mach-ii-for...@googlegroups.com
bclingan said the following on 11/04/2013 09:22 AM:
I've only see bad performance like this because CF template timings were
turned on. Usually that debug option adds about an 10 fold increase in
the amount of time needed to process a page. Have you checked your debug
settings? BTW, this isn't a Mach-II thing -- its any CFML app that uses
method calls and CFCs.

--
Peter J. Farrell
OpenBD Steering Committee / Mach-II Lead Developer
http://blog.maestropublishing.com
Identi.ca / Twitter: @maestrofjp

Please do not send me Microsoft Office/Apple iWork documents. Send OpenDocument instead! http://fsf.org/campaigns/opendocument/

bclingan

unread,
Nov 4, 2013, 3:40:26 PM11/4/13
to mach-ii-for...@googlegroups.com
I will double check our settings, but I believe we had all debugging turned off... the dataset in question that I'm attempting to render is 3000 records and each record has 6 links.

Peter J. Farrell

unread,
Nov 4, 2013, 3:56:06 PM11/4/13
to mach-ii-for...@googlegroups.com
bclingan said the following on 11/04/2013 02:40 PM:
> I will double check our settings, but I believe we had all debugging
> turned off... the dataset in question that I'm attempting to render is
> 3000 records and each record has 6 links.
>
Holy cow that is a lot of links to generate (~18,000). I can see it
taking a couple of seconds due to all the string concatenation going on
(which CFML isn't the fastest at doing).

You might be better off doing it manually or optionally generate temp
links with placeholders:

<cfset variables.link_01 = BuildUrlToModule("modulename", "eventname",
"id=XXXX") />

Then use ReplaceNoCase to replace the ID placeholder of XXXX:

<a href="#ReplaceNocase(variables.link_01, "XXXX", qry.id[i])#">Link</a>

You still the benefits of using BuildUrl without having to call it
18,000 times. It won't be as fast a hard coding urls with variable
output, but it should be much faster.
Reply all
Reply to author
Forward
0 new messages