Is there any significant improvement in SessionFactory Startup in using annotations over mappings?
I know there are a lot of factors that effect startup time such as complexity and length of the mapping, but because hibernate doesn't have to read in XML to map with annotations, I would guess that annotations are quicker overall.
Is this a false statement? Im trying to do some tests to find out, but because of WTP 0.7 and HibTools, im having difficulty right now. Just thought I'd ask the community.
I don't think there is much of a difference in speed. I think it is more of whether you want to manually make seperate XML mapping files, or include that with Annotations. Annotations use Inspection of the Java classes to make Objects that get created at startup, where of course XML uses an IO Reader to load the XML and create the objects.
I did some tests, (finally got WTP and hibtools working).
The more mapping files you have the time it takes to startup is linear. Depending on the size and complexity of your mapping files.
In my tests I used 2 mappings. A small mapping file (25 lines), then a large one (125 lines). They weren't complex, just property tags mostly.
My annotated class was a rewrite of the small mapping file. I'd show you the code, but I am not permited to do so. Just think of them as <id> and <property> tags. No sets or collections.
As you can see below the mappings take a bit longer, but not by very much. But their times are a more steep startup.