I am available for hire +1 407 982 5216 me@iamjamesgibson.com

James Gibson's adventures, thoughts and ramblings.

Coldfusion on Wheels (cfwheels) 1.1 release - Plugin Injection Performance Improved

12 August 2010

As with all frameworks, performance is a big part of what makes a framework great. With my ongoing work on Reservoir, we ran into an issue with wheels plugin performance.  We ran into this problem because we use so many plugins. Right now, Reservoir uses 32 different plugins to enhance the functionality of wheels or to add new functionality that we needed specifically for the application.

The changes made were small, but the performance improvement was HUGE. Before the change, it was taking upwards of 9 to 11 milliseconds for a model object to be created in the framework for our application. As you can imagine, just instantiating 20 model objects was taking 200+ milliseconds, completely unacceptable.

StructAppend to Save the Day

The saving grace in this change ends up being StructAppend(). By removing the loop to first save the original wheels method and then grab the new one from the plugin object, we use StructAppend to copy everything over at once saving us 7-10 milliseconds per instantiation. Not only do we get the increased performance (3 to 7 times faster) the revision actually ends up being less code in the framework.

If you are just starting out with wheels this change may not affect you much but you can have the confidence to know that when you app becomes more mature, the performance of you app will not suffer in this area.

You can find the enhancement in the upcoming release of wheels 1.1.

Filed under: Cfwheels, Coldfusion, Framework

5 Comments

  1. 6c5d8be6ffe678809cb737db55c761d2
    1. Mike Henke said almost 2 years ago

    Hi James,
    Some reason Chrome's picking up your rss feed via the extension. Could you add a RSS link some where on your page, so I can add you to my Google Reader subscriptions? Thanks

  2. A3ac4c33a61c34604e58aaae15a383a5
    2. James G. said almost 2 years ago

    Hey Mike,

    Thanks for the reply. We have it on the short list to get rss feeds done for the Reservoir platform. I will see what I can do to get it bumped up the list.

  3. 5eb7dc9121bd474726f9f5568c9573ed
    3. Per Djurner said almost 2 years ago

    32 plugins?!

    Curious, how do you manage dependencies between them, if you have any?

  4. A3ac4c33a61c34604e58aaae15a383a5
    4. James G. said almost 2 years ago

    Great question. There are not many dependencies between the plugins themselves. And probably half of the plugins are specifically for Reservoir. We do things like pinging the search engines whenever content is updated and we have a plugin to allow us to override display templates to easily customize specific functionality quickly.

  5. D41d8cd98f00b204e9800998ecf8427e
    5. user said 10 months ago

    According to my analysis, thousands of people all over the world get the credit loans at good banks. So, there's good possibilities to get a short term loan in any country.

Leave this field empty