From: Sergey V. (JIRA) <no...@at...> - 2006-06-30 20:24:16
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1490?page=comments#action_23510 ] Sergey Vladimirov commented on HHH-1490: ---------------------------------------- I don't know why is it expecive. May be need a good test case... But all my perfomance requests are from real application. I just making 3-5 stack traces and look, what methods are stuck. For example, I often see org.hibernate.type.EntityType.getReturnedClass(EntityType.java:91) org.hibernate.cache.QueryKey.equals(QueryKey.java:59) Other examples - HHH-1331 or HHH-1691 That's why i'm tring to optimize them. Preparing test case... > QueryCache should not call EntityType.getReturnedClass() or do it fast > ---------------------------------------------------------------------- > > Key: HHH-1490 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1490 > Project: Hibernate3 > Type: Improvement > Components: core > Versions: 3.1.2 > Environment: Hibernate 3.1.2, MySQL 5.0.18-nt > Reporter: Sergey Vladimirov > Priority: Minor > Attachments: patch.txt > > > org.hibernate.cache.QueryKey should not call EntityType.getReturnedClass() or do it fast, because EntityType.getReturnedClass() works with ClassLoader - i is very expensive operation: > Stack trace: > java.lang.ClassLoader.findLoadedClass0(Native Method) > java.lang.ClassLoader.findLoadedClass(ClassLoader.java:922) > java.lang.ClassLoader.loadClass(ClassLoader.java:295) > - locked sun.misc.Launcher$AppClassLoader@93dee9 > sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) > - locked sun.misc.Launcher$AppClassLoader@93dee9 > java.lang.ClassLoader.loadClass(ClassLoader.java:251) > org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:95) > org.hibernate.type.EntityType.getReturnedClass(EntityType.java:91) > org.hibernate.cache.QueryKey.equals(QueryKey.java:59) > org.apache.commons.collections.map.AbstractReferenceMap.isEqualKey(AbstractReferenceMap.java:433) > org.apache.commons.collections.map.AbstractHashedMap.getEntry(AbstractHashedMap.java:434) > org.apache.commons.collections.map.AbstractReferenceMap.getEntry(AbstractReferenceMap.java:404) > org.apache.commons.collections.map.AbstractReferenceMap.get(AbstractReferenceMap.java:229) > ru.arptek.common.collections.SynchronizedMap.get(SynchronizedMap.java:94) > Operations with ClassLoaders is not falst enought for equals() operations. May be one should add some kind of caching (in EntityType, for example) or compare EntityType by class names, not by Class objects. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |