Model-Glue:Unity gets faster!
Posted by Joe Rinehart at 7:49 AM
15 comments - Categories:
Model-Glue
After Sean Corfield clued me in to the performance impact of things like DuckTyping instead of strict typing in low-level code (like frameworks), I made some large changes to the Model-Glue:Unity core in terms of arguments and returntypes.
The result: whoa, that's fast.
Here's a few benchmarks from a 100-concurrent-user load test:
Application Template
Model-Glue 1.1 - 3095ms avg. request time
Model-Glue 1.1.1 RC1 - 1428
Model-Glue:Unity Beta 1 - 1430
Model-Glue:Unity BER - 596
Petmarket
Model-Glue 1.1.1 RC1 - 2892ms avg. request time
Model-Glue:Unity Beta 1 - 2602
Model-Glue:Unity BER - 2115
Lesson learned: ColdFusion checks metadata for typing and requirements at runtime. If you're in situation where every ms counts (like the Model-Glue request lifecycle), you may want to thing about loosely typing your code.
Peter Bell wrote on 06/22/06 9:00 AM
Hello Joe,Just to clarify, CF runs metadata type checking at runtime which can affect performance. Right?
Couple of questions:
How do you do loose typing?
- Returntype = any for methods
- Argument type = any for cfarguments
Anything else?
Also, I'm guessing this is not limited to instantiation of objects so object caching wouldn't avoid this problem - it would be every method call that would be slower - right?
As an associated question, any idea of the performance hit for using beans in your displays rather than queries or structs (First Name: #ThisUser.getFirstName()# instead of First Name: #FirstName#)? I'd always heard it was nominal, but if you're displaying collections of objects (vs. outputing from a cf query) is object instantiation time not the only thing you have to worry about from a performance perspective?
Any of Seans tips you could pass along would be much appreciated!
Best Wishes,
Peter