You could try storing your CFC's in a persistent scope (ie. Application, Session)
ie. Application.Com=structNew(); Application.Com.myCFC=createObject("component","com.myCFC"); You could create a function "init" which initialises all the things you need then returns the CFC instance, and the execute it as: Application.Com.myCFC=createObject("component","com.myCFC").init(); >From there you could start using it's functions without need for reinitialisation (if thats a word) <cfset myVar=Application.Com.myCFC.myFunction()> Duplicating CFC's sounds like barking up the wrong tree to me. You'll end up chewing resources and so forth. Joel -----Original Message----- From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] Behalf Of Scott Arbeitman Sent: Thursday, 20 July 2006 6:24 PM To: cfaussie Subject: [cfaussie] Duplicating CFC instances (very interesting behaviour) We have a production enviornment where trusted cache simply cannot be enabled. This is causing performance issues because some requests are creating many components, and each creation takes some time as ColdFusion will do some disk I/O. Overhead is about 30 ms per instance creation, which adds up. I reckon I can get this number below 5 ms but cloning a CFC in memory which means NOT using CreateObject. Now, I know that Duplicate makes deep copies of structs. When applied to a CFC instance, it seems to create a struct, where the keys are the method names and the values are the methods. I can still call these methods just like a CFC which is nice. However, I have some logic which is performed when IsObject is true, which is not for these CFCs. I'm fishing for ideas here on the best way to duplicate a CFC without touching the file systems, while preserving that IsObject will be true for the new object. I'm open to Java ideas as well. I've tried things like cfc.getClass().newInstance(), but this doesn't get me anywhere. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie -~----------~----~----~----~------~----~------~--~---