Thread: RE: [OJB-developers] Lots of class mappings in OJB Problem
Brought to you by:
thma
From: John F. <jfr...@so...> - 2002-04-25 17:38:10
|
Turn off any logging about the parsing of the XML file. - John > -----Original Message----- > From: Matthew Baird [mailto:ma...@so...] > Sent: Thursday, April 25, 2002 12:35 PM > To: 'obj...@li...' > Subject: [OJB-developers] Lots of class mappings in OJB Problem >=20 >=20 > My project has between 200 and 250 mapped classes, and is=20 > taking a *long* > time for OJB to initialize. Is there any way to speed this up? >=20 > regards, > Matthew >=20 > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers >=20 |
From: Matthew B. <ma...@so...> - 2002-04-26 03:26:24
|
All logging is off. The console is virtually empty after the run, and still, it takes over 6 minutes to load all the class descriptors. Any other ideas short of coding changes? Thomas?? m -----Original Message----- From: John Freeborg [mailto:jfr...@so...] Sent: Thursday, April 25, 2002 10:38 AM To: Matthew Baird; obj...@li... Subject: RE: [OJB-developers] Lots of class mappings in OJB Problem Turn off any logging about the parsing of the XML file. - John > -----Original Message----- > From: Matthew Baird [mailto:ma...@so...] > Sent: Thursday, April 25, 2002 12:35 PM > To: 'obj...@li...' > Subject: [OJB-developers] Lots of class mappings in OJB Problem > > > My project has between 200 and 250 mapped classes, and is > taking a *long* > time for OJB to initialize. Is there any way to speed this up? > > regards, > Matthew > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > _______________________________________________ Objectbridge-developers mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-developers |
From: Matthew B. <ma...@so...> - 2002-04-26 20:33:36
|
I will try this asap. I'm not sure that parsing is the bottleneck, as there is a lot of work done mapping the classes. However, if this work is done once and represented inside the serialized class, that would be great. I will report back soon with statistics on where the time is being spent. m -----Original Message----- From: Thomas Mahler [mailto:tho...@ho...] Sent: Friday, April 26, 2002 2:07 PM To: Matthew Baird Cc: 'obj...@li...' Subject: Re: [OJB-developers] Lots of class mappings in OJB Problem Hi Matthew, sorry for answering late, I had been on a 3 day business trip. Matthew Baird wrote: > My project has between 200 and 250 mapped classes, and is taking a *long* > time for OJB to initialize. Is there any way to speed this up? I don't think that we speed up the parsing process much. It's already implemented with SAX, which is much faster than DOM and there is not much to improve here. But to speed up your "lots of classes" scenario I just checked in a little hack into the CVS (I made changes to ClassDescriptor, DescriptorRepository and RepositoryPersistor): It now works like follows: 1. The Persistory is asked to read in a Repository from a file (say "repository.xml"). 2. The persistor checks if a file "repository.xml.serialized" exists. 2a) if this file exists, the Persistor deserializes a DescriptorRepository instance from this file. This instance is returned and thus the slow XML parsing of "repository.xml" is avoided. 2b) if not, it performs the ordinary SAX parsing of the "repository.xml" file. The resulting repository object is immediately serialized to the file "repository.xml.serialized". Thus it can be used on the next application startup. I assume that Java-deserialization is much faster than SAX Parsing. How long does the Application startup take with this solution for your scenario? I will polish up things a little, but I think it is OK to use this stuff already. cheers, Thomas > > regards, > Matthew > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > > > > _______________________________________________ Objectbridge-developers mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-developers |
From: Matthew B. <ma...@so...> - 2002-04-26 20:44:57
|
Poor man's profiler gave these results: parse of XML file (everything but attributedescriptorbase work) was 28.2 seconds PersistentFieldFactory.createPersistenceField called from attributedescriptorbase took 254.1 seconds Will update with results of Thomas's "hack" |
From: Thomas M. <tho...@ho...> - 2002-05-02 04:59:13
|
Hi Matthew, I just fixed all these bugs. The whole OJB TestSuite now passes with using the PropertyFieldImpl. I also got everything running with the using the repository serialization. There is now a flag in OJB.properties that can be used to enable loading of the serialized repository: useSerializedRepository=true I noticed that using XML and PropertyFieldImpl takes nearly 2 times longer than using PersistentFieldDefaultImpl. If you switch useSerializedRepository to true loading takes almost the same time. I hope this helps to solve your "many classes" problem. Thomas Matthew Baird wrote: > Turns out PropertyDescriptor is not marked serializable. > > so I marked it transient, although this will have problems I'm sure. > > After looking at the PropertyFieldDefaultImpl, the "Field" is marked > transient. Won't this cause problems when you deserialize the class and try > to use it? > > m > > 14:26:21,340 INFO [STDOUT] Could not write to > fileC:\jboss-3.0.0RC1_tomcat-4.0.3\bin\repository.xml.serialized > 14:26:21,340 INFO [STDOUT] java.beans.PropertyDescriptor > 14:26:21,340 ERROR [STDERR] java.io.NotSerializableException: > java.beans.PropertyDescriptor > 14:26:21,340 ERROR [STDERR] at > java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1148) > 14:26:21,340 ERROR [STDERR] at > java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366) > 14:26:21,350 ERROR [STDERR] at > java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1827) > 14:26:21,360 ERROR [STDERR] at > java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480) > 14:26:21,360 ERROR [STDERR] at > java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214) > 14:26:21,370 ERROR [STDERR] at > java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366) > 14:26:21,370 ERROR [STDERR] at > java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1827) > 14:26:21,370 ERROR [STDERR] at > java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480) > 14:26:21,370 ERROR [STDERR] at > java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214) > 14:26:21,370 ERROR [STDERR] at > java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366) > 14:26:21,370 ERROR [STDERR] at > java.io.ObjectOutputStream.outputArray(ObjectOutputStream.java:1098) > 14:26:21,370 ERROR [STDERR] at > java.io.ObjectOutputStream.checkSubstitutableSpecialClasses(ObjectOutputStre > am.java:4 > 56) > 14:26:21,370 ERROR [STDERR] at > java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:361) > 14:26:21,370 ERROR [STDERR] at > java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1827) > 14:26:21,370 ERROR [STDERR] at > java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480) > 14:26:21,370 ERROR [STDERR] at > java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214) > 14:26:21,370 ERROR [STDERR] at > java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366) > 14:26:21,370 ERROR [STDERR] at > java.util.Hashtable.writeObject(Hashtable.java:764) > 14:26:21,370 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native > Method) > 14:26:21,370 ERROR [STDERR] at > java.io.ObjectOutputStream.invokeObjectWriter(ObjectOutputStream.java:1864) > 14:26:21,380 ERROR [STDERR] at > java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1210) > 14:26:21,380 ERROR [STDERR] at > java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366) > 14:26:21,380 ERROR [STDERR] at > java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1827) > 14:26:21,380 ERROR [STDERR] at > java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:480) > 14:26:21,380 ERROR [STDERR] at > java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1214) > 14:26:21,380 ERROR [STDERR] at > java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366) > 14:26:21,380 ERROR [STDERR] at > ojb.broker.metadata.RepositoryPersistor.serialize(RepositoryPersistor.java:3 > 45) > 14:26:21,380 ERROR [STDERR] at > ojb.broker.metadata.RepositoryPersistor.readFromFile(RepositoryPersistor.jav > a:183) > 14:26:21,380 ERROR [STDERR] at > ojb.broker.metadata.DescriptorRepository.getInstance(DescriptorRepository.ja > va:379) > 14:26:21,380 ERROR [STDERR] at > ojb.broker.ta.PersistenceBrokerFactoryDefaultImpl.createPersistenceBroker(Pe > rsistence > BrokerFactoryDefaultImpl.java:255) > > > > -----Original Message----- > From: Thomas Mahler [mailto:tho...@ho...] > Sent: Friday, April 26, 2002 2:07 PM > To: Matthew Baird > Cc: 'obj...@li...' > Subject: Re: [OJB-developers] Lots of class mappings in OJB Problem > > > Hi Matthew, > > sorry for answering late, I had been on a 3 day business trip. > > Matthew Baird wrote: > > >>My project has between 200 and 250 mapped classes, and is taking a *long* >>time for OJB to initialize. Is there any way to speed this up? >> > > > I don't think that we speed up the parsing process much. It's already > implemented with SAX, which is much faster than DOM and there is not > much to improve here. > > But to speed up your "lots of classes" scenario I just checked in a > little hack into the CVS (I made changes to ClassDescriptor, > DescriptorRepository and RepositoryPersistor): > > It now works like follows: > 1. The Persistory is asked to read in a Repository from a file (say > "repository.xml"). > 2. The persistor checks if a file "repository.xml.serialized" exists. > > 2a) if this file exists, the Persistor deserializes a > DescriptorRepository instance from this file. > This instance is returned and thus the slow XML parsing of > "repository.xml" is avoided. > > 2b) if not, it performs the ordinary SAX parsing of the "repository.xml" > file. The resulting repository object is immediately serialized to the > file "repository.xml.serialized". Thus it can be used on the next > application startup. > > I assume that Java-deserialization is much faster than SAX Parsing. > How long does the Application startup take with this solution for your > scenario? > > I will polish up things a little, but I think it is OK to use this stuff > already. > > cheers, > > Thomas > > > >>regards, >>Matthew >> >>_______________________________________________ >>Objectbridge-developers mailing list >>Obj...@li... >>https://lists.sourceforge.net/lists/listinfo/objectbridge-developers >> >> >> >> >> > > > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > > > > |