Hi,
I have a single threaded application that reads ascii data from a flat file, does some processing and inserts records into the DB using Hibernate. The record has close to 200 fields that are stored in columns in a single table. A unique PK is generated by Hibernate for each record from an Oracle sequence, the mapping is defined in the hbm.xml.
I am getting a performance of 40 min for 100K records. I commit after every 100 save(). I am using only default Hibernate properties. How can I improve the performance?
I ran this app with the profiler turned on, the profiler output shows bulk of the time is spent in Object.wait(). Where is this happening? There is no stack trace available for the call. The profiler complained about methods not available at the top of the stack. Is this because the byte code is modified by cglib? Prof output:
Code:
TRACE 8889:
java.lang.Object.wait(Object.java:Unknown line)
java.lang.Object.wait(Object.java:Unknown line)
TRACE 8888:
java.lang.ref.ReferenceQueue.enqueue(ReferenceQueue.java:Unknown line)
TRACE 8890:
java.lang.Object.wait(Object.java:Unknown line)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:Unknown line)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:Unknown line)
CPU TIME (ms) BEGIN (total = 947706) Fri Nov 7 11:45:14 2003
rank self accum count trace method
1 23.63% 23.63% 3 8889 java.lang.Object.wait
2 23.63% 47.26% 3 8890 java.lang.Object.wait
3 1.98% 49.24% 2461438 1007 net.sf.hibernate.impl.SessionImpl.updateReachable
4 1.86% 51.10% 2461438 2162 net.sf.hibernate.impl.SessionImpl.wrap
5 1.11% 52.21% 2461438 7338 net.sf.hibernate.type.AbstractType.isDirty
6 1.06% 53.27% 2403820 8593 net.sf.hibernate.type.StringType.equals
7 1.02% 54.29% 4226 7689 java.net.SocketInputStream.socketRead0
8 0.85% 55.14% 11597 2181 net.sf.hibernate.impl.SessionImpl.updateReachables
9 0.78% 55.93% 192000 6142 java.lang.Class.getMethod0
10 0.71% 56.64% 1000 3480 com.sbc.orderprocessor.asiadapter.ASIFeedParser.createInstance
11 0.64% 57.27% 11597 3353 net.sf.hibernate.impl.SessionImpl.wrap
12 0.62% 57.89% 2265938 5521 net.sf.hibernate.type.AbstractType.isComponentType
13 0.62% 58.51% 2265938 8629 net.sf.hibernate.type.AbstractType.isPersistentCollectionType
14 0.61% 59.12% 2265938 7339 net.sf.hibernate.type.AbstractType.isPersistentCollectionType
15 0.61% 59.73% 2403820 4524 org.apache.commons.lang.ObjectUtils.equals
16 0.61% 60.34% 2265938 4654 net.sf.hibernate.type.AbstractType.isComponentType
17 0.59% 60.93% 1003278 3252 java.lang.String.indexOf
18 0.58% 61.51% 272606 4914 java.util.StringTokenizer.scanToken
Regards,
Vaishali