Speed advantage CreateObject in applicationstart()

Skip to first unread message


Nov 15, 2015, 5:08:37 AM11/15/15
to cfpayment
Is it faster to create the cfpayment.api.core object in onApplicationStart instead of in the method/function
that is being called on every charge? I assume so but just checking?


Brian G

Nov 16, 2015, 4:30:19 PM11/16/15
to cfpayment
Creating it is very lightweight, but this is really a regular ColdFusion question. Yes, it's more performant to cache the instance in a persistent scope but it comes with the regular set of trade offs with putting anything else in the application scope.

Phillip Senn

Nov 16, 2015, 4:45:13 PM11/16/15
to cfpa...@googlegroups.com
It's not worth the hassle.
Once your application starts accepting many thousands of payments per second then you can put it into the Application scope.

Until then, the amount of time you've spent researching this vastly eclipses the amount of time saved by the users.

Premature Optimization.

You received this message because you are subscribed to the Google Groups "cfpayment" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cfpayment+...@googlegroups.com.
To post to this group, send email to cfpa...@googlegroups.com.
Visit this group at http://groups.google.com/group/cfpayment.
For more options, visit https://groups.google.com/d/optout.


Nov 17, 2015, 6:45:29 PM11/17/15
to cfpayment
Thanks guys, I know object creation is not much of an issue these days but I'm always interested in other opinions.
Reply all
Reply to author
0 new messages