2 Replies Latest reply: Aug 24, 2007 10:54 AM by BKBK RSS

    How costly is the instantiation of a gateway's listener CFC?

    BKBK Community Member
      You have configured a gateway instance in the Coldfusion Administrator. It has the usual listener CFC and configuration file. Assume the gateway is running.

      How is the gateway's listener CFC invoked? How often? As the gateway service is event-based, can one assume that the CFC is instantiated per event? What are the performance costs, if any?

        • 1. Re: How costly is the instantiation of a gateway's listener CFC?
          Newsgroup_User Community Member
          In article <fak4kj$4bg$1@forums.macromedia.com> "BKBK"
          <webforumsuser@macromedia.com> wrote:
          > How is the gateway's listener CFC invoked? How often? What are the
          > performance costs, if any?

          The CFC is instantiated on every request.

          I run the IRC #coldfusion channel bot (on dal.net). It's a ColdFusion
          event gateway (downloadable from my blog).

          At one point I was concerned about the performance cost of
          instantiating the gateway on every request (for every single message
          written into the channel!). So I created a variant that had the main
          bot code in a CFC in application scope and a lightweight CFC that was
          used as the gateway, which delegated onIncomingMessage() to the CFC in
          application scope.

          I tested it under load and the difference in performance was
          negligible.

          So I wouldn't worry about it.

          Sean Corfield
          An Architect's View -- < http://corfield.org/>


          --
          I'm using an evaluation license of nemo since 79 days.
          You should really try it!
          http://www.malcom-mac.com/nemo

          • 2. Re: How costly is the instantiation of a gateway's listener CFC?
            BKBK Community Member
            Sean,
            Thanks for the illuminating piece of information on gateways, and for the nemo tip.