|
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Is this Application cfm abuse?
I'm working on a project and when I dumped the application scope there were over 25,000 lines of variables and struct items. When I saved all of this it was over 500k. Does this seem unusual?John Engstrom 04/23/08 05:17 P > I'm working on a project and when I dumped the application scope thereJosh Nathanson 04/23/08 05:30 P Hmm, it depends.Nathan Strutz 04/23/08 05:30 P John,Jon Clausen 04/23/08 09:36 P Not really, as long as it makes sense in the larger context of theCameron Childress 04/24/08 07:01 A However, if he means that the file itself is actually 25,000 lines of code,Brian Kotek 04/24/08 08:18 A He said "when I dumped the application scope".Cameron Childress 04/24/08 08:36 A Very true, I missed the "dump" part.Brian Kotek 04/24/08 08:58 A I'm working on a project and when I dumped the application scope there were over 25,000 lines of variables and struct items. When I saved all of this it was over 500k. Does this seem unusual? > I'm working on a project and when I dumped the application scope there > were over 25,000 lines of variables and struct items. When I saved all of > this it was over 500k. Does this seem unusual? That seems pretty excessive. Do you mean there were 25K lines in Application.cfm, or there were 25K variables in the Application scope, or some combination thereof? -- Josh Hmm, it depends. 500k of application memory doesn't really sound bad - how much memory does the server have - I'm sure 500kb doesn't really matter. As far as abusing the application scope - is the data well organized? Are the variables logically named? Are they correctly scoped? They should not be related to any clients using the system, but are indeed application configuration settings. Are they values that are better left in a stylesheet or on a page-configuration level as opposed to an application configuration level? If the data is a lot of manually cached queries or data, this, too, would make sense, though it might be better to make a reusable caching service. The newer way of handling application configuration settings is probably something more along the lines of hiding a lot of the configuration through a CFC or CFCs and make the application configuration a managed data process. One of the best things I've seen is putting many of these settings in a coldspring services.xml file and providing settings where they are needed instead of globally to the entire application. YMMV (Your Mileage May Vary) and it really depends on the application and the implementation. -- nathan strutz http://www.dopefly.com/ > I'm working on a project and when I dumped the application scope there > were over 25,000 lines of variables and struct items. When I saved all of > this it was over 500k. Does this seem unusual? John, It depends on the application, though I don't think 500k is particularly high. The apps I have built using FarCry seem to use about 375-400kb on app init - before any queries are cached (those are on 3.5 so much has probably changed in 4.0 and the new release upcoming). Between query and object caching, I think if the way the application is used and the server can justify the memory usage it's not too much of a concern. The biggest application scope abuse I've seen is using it to store data that should be maintained in session, client, or even request. This results in a ton of updating of application variables and excessive locking in some cases. It might be bad form to use an excessive amount of memory on shared hosting, though. Jon On Apr 23, 2008, at 5:16 PM, John Engstrom wrote: > I'm working on a project and when I dumped the application scope > there were over 25,000 lines of variables and struct items. When I > saved all of this it was over 500k. Does this seem unusual? Not really, as long as it makes sense in the larger context of the application. If you are looking for a rule of thumb here, I would make it Never do this: <cfdump var="#application#"/> :) -Cameron > I'm working on a project and when I dumped the application scope there > were over 25,000 lines of variables and struct items. When I saved all of > this it was over 500k. Does this seem unusual? However, if he means that the file itself is actually 25,000 lines of code, and that when he saved it the file size was 500k, then yes, I'd say that is almost definitely a very bad design choice. On Thu, Apr 24, 2008 at 7:01 AM, Camer ----- Excess quoted text cut - see Original Post for more ----- He said "when I dumped the application scope". But you are right. CFMX 6.1 wouldn't even execute a file longer than ~10k lines. I haven't come across code that heinous since then. -Cameron On Thu, Apr 24, 2008 at 8:18 AM, Brian Kotek <brian428@gmail.com> wrote: > However, if he means that the file itself is actually 25,000 lines of > code, > and that when he saved it the file size was 500k, then yes, I'd say that > is > almost definitely a very bad design choice. > > -- Cameron Childress Sumo Consulting Inc http://www.sumoc.com --- cell: 678.637.5072 aim: cameroncf email: cameronc@gmail.com Very true, I missed the "dump" part. As far as things in the application scope, 500k is not a lot. For the 25,000 variables, that does seem like a lot, but it probably depends on what that means. Are there CFCs in the application scope? Is the app using a framework like Fusebox? Is it using ColdSpring? All of those things will put data and CFC instances into the application scope, so if that is the case and it is a large app, I could easily see 500k of data in the application scope. On Thu, Apr 24, 2008 at 8:35 AM, Camer ----- Excess quoted text cut - see Original Post for more -----
|
Mailing Lists
|
Latest Fusion Authority Articles
|
||||||