2 Replies Latest reply on Jun 30, 2007 12:38 PM by Chuck1411

    speeding up gateway calls

    Chuck1411 Level 1
      In application.cfc onRequestStart, I've seen the targetPage as /flashservices/gateway.

      How do I utilize that to make the call use an instantiated object to speed up access? Currently the only way I know is to allow the service cfc to be called (instantiated) with each call, and within it to call a scope resident cfc. I'm hoping there is a way to use the application.cfc to skip the instantiation of the service cfc for each call.

      Obviously if there is a way I'd need to retain any passed in parameters. Thx for any help.
        • 1. Re: speeding up gateway calls
          Level 7
          In article <f64kcs$qcp$1@forums.macromedia.com>
          "Chuck1411"<webforumsuser@macromedia.com> wrote:

          > In application.cfc onRequestStart, I've seen the targetPage as
          > /flashservices/gateway.
          >
          > How do I utilize that to make the call use an instantiated object
          > to speed up access? Currently the only way I know is to allow the
          > service cfc to be called (instantiated) with each call, and within it
          > to call a scope resident cfc.

          Remoting calls - like web service calls - always create a new instance
          of the CFC.
          Are you really seeing a performance improvement by having your service
          CFC delegate to a shared scope instance?
          I ask because I ran a number of performance tests against my IRCbot
          (an event gateway CFC - which is also created on every request). I
          found no noticeable performance improvement from keeping a single
          instance of the CFC in application scope and delegating from a simple
          event gateway CFC to that shared instance, compared to just letting
          ColdFusion create the CFC on each request.
          You may be spinning cycles trying to optimize something that doesn't
          actually need optimizing...
          It's also worth noting that CF8 has *dramatically* speeded up CFC
          creation anyway.

          --
          I'm trying a new usenet client for Mac, Nemo OS X.
          You can download it at http://www.malcom-mac.com/nemo

          • 2. speeding up gateway calls
            Chuck1411 Level 1
            Thx, that is good to know. Your right, I had just presumed that an already instantiated object would be faster. At the moment I have a service cfc that include's the appropriate method on call, so not every method gets instantiated (with each service cfc call). I'd assumed I would need to recreate this so that each method would be a cfc on its own, and would get instantiated into a struct array of objects the first time it is called and then recalled each time after as needed. I guess I don't have to do that.