Issue Type: Improvement Improvement
Affects Versions: 4.1.8, 3.3.2
Assignee: Unassigned
Attachments: JarVisitorFactoryTest.java
Components: entity-manager
Created: 29/Nov/12 11:16 AM
Description:

Implementation of JarVisitorFactory.getBytesFromInputStream is not efficient. Data loaded from the stream is copied over and over again in memory as the data is fetched.

Because of this problem creation of local EntityManagerFactory is slow for us in hibernate 3.4.0 (~40 seconds). We profiled start-up and found this method being bottleneck (>90% of time spent). Although we have not tested creation of EntityManagerFactory with the latest version of hibernate, this method is there in hibernate 4.1.8 and should be updated.

Attached is alternative implementation of method and performance test.
In our test we loaded 2491475 bytes:
Current implementation: 219 ms
Suggested implementation: 5 ms

Environment: Windows x64, RedHat Linux x64, HIbernate 3.4.0 GA
Project: Hibernate ORM
Labels: hibernate
Priority: Major Major
Reporter: Andriy Kharchuk
Original Estimate: 1h
Remaining Estimate: 1h
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira