Henri Tremblay wrote:

One other thing that takes time is reflection. I don't know if some calls to
ReflectHelper can be replaced by static code but it would help.



Hum, would be interesting to see if startup is faster when all types are specified in the mapping.


I guess it would then also be possible to delay some classloading....

Without caring about profiling I would have proposed two solutions:
1- Have hibernate being sloppier. I think it's doing a lot of validations
when loading the configuration. Maybe we can have a mode where it doesn't do
all that.


Hum yes, perhaps....


2- Lazy load the conf. I mean, don't load every file at the beginning, only
when the session using the configuration needs it. So for instance load a
persistent class only when there's a query on it. Again, a having the two
possibilities will be nice (everything at startup or as needed). However, as
Gavin said, it might not be possible... One cannot guess where is the class
of query he is looking for. It might become possible it we change the
approach. For instance having a addLazyClass(Class persistentClass) method
so you know that it you need the mapping the the class, you know it's in the
hbm.xml having the same name.



This would be really hard. Remember that each class needs to know about all associated classes
to figure out fk types, etc.



P.S.: Something that has nothing to do with what's above. If you have a
query "from Player as player where player.team = :team", is it more
efficient than "from Player as player where player.team.id = :team" or it
doesn't make any difference?




Shouldn't be any difference.


--
Gavin King
+61 410534454

Hibernate
[EMAIL PROTECTED]
http://hibernate.org

JBoss Inc
[EMAIL PROTECTED]
http://jboss.com



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to