The Example
I'm writing an utility to transform domain classes, pojos and pogos in CSV, using OpenCSV. The example that I created is available on git.
The idea is to go to the index action of the TestController
and hit the button that will make an ajax call. This ajax will transform all instances of the domain class Test
, created on bootstrap, in CSV and return this text to the view.
The flow
- Bootstrap creates 5000 records of domain class
Test
- User go to index page: /csv-example/test/index
- User hit the button, making ajax request
- Controller list all Test records
- Controller transform
ArrayList
in aString
csv formattedDefaultCSVConverter
will look for the serializer for the class TestDomainClassSerializer
will transform the instance inList<String[]>
DefaultCSVConverter
will use OpenCSV to write theList<String[]>
The Problem
Grails is much faster if I run this example app in production
mode, and I'm trying to understand why. I already tried to run in dev
mode, disabling the realoding agent:
grails Ddisable.auto.recompile=true -noreloading run-app
This makes no difference in the time spent to transform the instances.
So my question is: beside the reloading agent, what more can make this performance different between development and production modes?
The Env
Grails 2.2.1
Win 7 x64
JDK 1.6.0_43 64 bits