Tag Archives: Grails

S2G Conference, London May 31st – Notes on Tuning Grails Apps, Peter Ladbroke

How to get the most out of the grails app

Many people make decision based on delusions that you will scale up to Facebook sizes. Making decisions based on those requirements is ridiculous.

Premature Optimization
Profile then optimise. Where can things be slow – DB/BusinessLogic/Network/UI

Profilers
Spring Insight – free with STS. gives a broad range of metrics
Google Speed Tracer
Reduce the number of DB queries
use appropriate fetch mode
don’t fetch the data you don’t need
Add appropriate indexes
Don’t be afraid to change the model

Caching
Aternative Data store – e.g. NoSQL for example but how do you know the sweetspot
The key us referential integrity and simple models
Spring caching abstraction
Go Asynchnoous – Spring Events, Executor, Messaing JMS/AMQP

Fall back to Java for Performance – especially for numerically intensive operations

Groovy++ @Typed(TypePolicy.MIXED) for speed increase

View rendering in GSPs
Reduce number of requests
Bundle CSS and JavaScript + minify and compress
Image Spriting
Expires Headers on static resources
Spring Cache with Views
Zipped Static resources

Grails in Action