Here’s my scenario:
I’m reworking a legacy CF website which largely consists of a few large .cfm files that contain functions that are cfincluded into each page request so that each component rendering data/views for each section of the website can access any function necessary. Each of these functions .cfm files is thousands of lines of code.
I’m currently reworking this website in more of an MVC type architecture. As part of this, I’m breaking apart these huge .cfm files and converting them to like functionality grouped .cfcs. These cfcs are simply data access singletons. Because of this, I’m loading them into the application scope on application start. Each section of the website is calling cfc methods to get data. Some of our site pages are rather large, and we’re getting data from many cfcs for a single page (think modern long page website with lots of data).
Here’s my problem. The new architecture feels much more maintainable, however, and this surprises me, the performance (at least in development) is worse to the old architecture. For some of the largest pages, I’m getting speeds 50% slower in the new setup. I realize there are many variables here, one of which is the fact that the application scope is significantly heavier under the new architecture, but not too large (460Kb). Another factor is that where there used to be fewer files needed to build a page request, there are 3-4 times more involved due to splitting things apart. The speeds I’m talking are .40 seconds vs .80 seconds. Both very fast, but why is my performance suffering so much?
Any thoughts or things I need to be checking?