So, I added the grails UI performance plugin to my app over the weekend. It basically promises to provide build and app support for the 14 rules of High Performance Websites from Steve Sounders.
These are things like:
- Adding far futures expires headers to relatively static resources like images, CSS and JS
- minification and compression of CSS and JS
- bundling of different CSS and JS files into singular files at build time
- Keeping the CSS at the top of the page and javascript at the bottom
But does it work? Yeah, it appears to. I ran some tests having the performance tuning on and off. This first picture is with no performance tuning (cache primed). The page took 3.57 seconds to render.
No performance tuning with primed cache
This second picture is with UI performance plugin turned on. The page took 1.74 seconds to render, and the number of requests for resources dropped dramatically. That is a 48% increase in performance, and if you look at the time to return the HTML page, it was significantly higher the second time around.
All in all, it took about 2-3 hours to get the plugin wired up appropriately for my app and to make the view change necessary. In the future, I would probably wire this plugin early so you can use its tags as you go. Also, this only applies to the app when running as a war, so use grails run-war to test it out. Once you have it configured, you will need to turn it off in the development environment to be able to run your app with grails run-app again. This just requires uiperformance.enabled = false in your development config.

No comments:
Post a Comment