-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Incredibly poor performance after switching to annotations
PostPosted: Thu Jun 17, 2010 6:27 pm 
Newbie

Joined: Tue Feb 27, 2007 12:31 pm
Posts: 8
Location: nyc
we are currently using hibernate 3.3.2 and spring 2.5.6. we were using xdoclet to generate our hibernate cfg files from our java files. we switched to using annotations. nothing else was changed in our codebase. we have seen a performance degradation of at list 4 fold and in some cases 10 fold. we have also noticed that we need to allocate significantly from ram to the jre to even run the tests.

has anyone else experienced this?


Top
 Profile  
 
 Post subject: Re: Incredibly poor performance after switching to annotations
PostPosted: Fri Jun 18, 2010 4:53 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
reading the annotations has an overhead, so you might theoretically experience a slower startup - never noticed though - but it shouldn't be slower after the SessionFactory is initialized.
Do you have some numbers? Can you verify there's slowdown even during usage (not during startup) ?

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Incredibly poor performance after switching to annotations
PostPosted: Fri Jun 18, 2010 8:41 am 
Newbie

Joined: Tue Feb 27, 2007 12:31 pm
Posts: 8
Location: nyc
startup is definitely slower, but only a little. it's runtime that is slower.

we have verified that we seem to be getting roughly the same sql across our tests. (we have some places where we didn't set the fetch correctly so we are getting a little more sql but only 2-3% more)

we have noticed a lot of 'pausing'. a whole batch of tests will run, then one will just site for many seconds, then it all starts up again.

as a test i ran with hibernate 3.5.3 and spring 3.0.x and it was better, but still 3 times slower than 3.3.2 and 2.5.6 without annotations.


Top
 Profile  
 
 Post subject: Re: Incredibly poor performance after switching to annotations
PostPosted: Fri Jun 18, 2010 9:26 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
as a test i ran with hibernate 3.5.3 and spring 3.0.x and it was better, but still 3 times slower than 3.3.2 and 2.5.6 without annotations.

So there might be something going wrong there, but you don't have a proof that's the fact you switched to annotations right?
You should try using the exact same versions and queries.

Might be offtopic, but I'm interested to hear about the performance difference between hibernate 3.3.2 and 3.5.3 - tough it doesn't seem related to using/not using annotations.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Incredibly poor performance after switching to annotations
PostPosted: Fri Jun 18, 2010 11:08 am 
Newbie

Joined: Tue Feb 27, 2007 12:31 pm
Posts: 8
Location: nyc
yes i have proof. same exact code base. in one case i use AnnotationConfiguration to configure hibernate and in the other i use the basic Configuration class to configure hibernate from xml mapping files. at least a 10x performance degradation.

i have even run tests where i take spring out of the equation and just create hibernate sessions directly.

i have also tried running with java6 instead of our default of java5

i am either doing something completely wrong, or there aren't a lot of people that have migrated from xml config to annotations, or other people would have had the same issues.


Top
 Profile  
 
 Post subject: Re: Incredibly poor performance after switching to annotations
PostPosted: Fri Jun 18, 2010 11:10 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
if you could post this test we might be able to fix it

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.