From: <leg...@at...> - 2004-01-27 21:35:54
|
The following comment has been added to this issue: Author: Juho Snellman Created: Tue, 27 Jan 2004 3:35 PM Body: The fix is working correctly on my tests (i.e. collection caching now improves performance, instead of the earlier dramatic performance loss). On one dataset, CVS Hibernate finishes in 3 minutes while 2.1.1 with the same cache configuration takes 46 minutes. Thanks! --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-587 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-587 Summary: Lazy collections not lazy when used with second level cache Type: Bug Status: Closed Priority: Major Resolution: FIXED Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate2 Components: core Fix Fors: 2.1.2 Versions: 2.1.1 Assignee: Gavin King Reporter: Juho Snellman Created: Tue, 30 Dec 2003 8:53 AM Updated: Tue, 27 Jan 2004 3:35 PM Environment: Hibernate 2.1.1 ehcache Description: When an object is loaded from the second level cache, any of its collections that are found from the cache are immediately initialized. This happens for both lazy and non-lazy collections. These initializations then cascade on to the contents of the collection, and their child-collections. For a sufficiently large and interconnected graph of objects this results in a disastrous performance loss when caching is enabled. In my particular case a test enabling caching increases the runtime of a test from about 12 minutes to over 40 minutes. In the latter case SessionImpl.getCachedCollection() takes up 68% of the runtime. Disabling caching only for collections brings the runtime back down. Aside from the performance issue, it seems to me that initializing lazy collections is also conceptually wrong. Shouldn't laziness mean "no work is done unless it's neccessary", instead of "nothing is fetched from the DB unless it's neccessary"? I'm pretty sure this didn't happen with Hibernate 2.0 and JCS. --------------------------------------------------------------------- JIRA INFORMATION: 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 If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |