On Mon, Nov 1, 2010 at 12:08 PM, Michael Pickelbauer <[email protected]> wrote: > Hello, > > I developed a application using Tuscany SCA M3 native and SDO on Ubuntu > 9.04. I coded in C++ and actually everything works fine, I am just facing a > performance issue. When I analyzed the code, I discovered that the following > lines use most time, compared to other sections of my program: > > //this command executes still fast > DataFactoryPtr mdg = DataFactory::getDataFactory(); > > //this two lines run very slow > XSDHelperPtr xsh = HelperProvider::getXSDHelper( mdg ); > xsh->defineFile("myMessageStruct.xsd"); > > //and continue fast... > const Type& tmsg = mdg->getType("MyMessageNS","MyMessageType"); > > The slow part is, when creating a SDO message to send it via a SCA binding > to an other component, so no WebServices or anything else is included. > > I guess the reason is, that the I/O to load the file and process the XML is > causing the delay. As the xsd file is not changing during run time, I came > up with the idea to just load the file once and then keep the structure in > memory. So I tried to save the variable /mdg/ and /xsh/ in static variables > and just load it on the first call. It worked for the first call, but at the > second I got following exception: > > Exception in createSdoStructure! > Exception object : > class: SDOUnsupportedOperationException > file name: DataFactoryImpl.cpp > line number: 491 > function: "DataFactory::addPropertyToType" > description: Adding Properties after type completed > location history: > terminate called after throwing an instance of 'SDONullPointerException' > Aborted > > Obviously it's not working that easily ;) > > My question is: is there a way to avoid loading the .xsd file every time I > want to create a SDO message? And if so, how can I do it or where can I find > information? > > A second question I have: I built SCA and SDO with the build_scanative.sh > respectively build_sdocpp.sh script and thus without any custom parameters. > While compiling I think I have seen some debug options. So I am wondering if > there are any compiler options to maybe speed up the application. > > Finally I have to mention, that due to project requirements I have to use > tuscany M3. > > Thanks for your help in advance! > > Best Regards > Michael > >
Hi Michael It's a long time since I've looked at the C++ runtime but one thing does come to mind. Does the schema your loading make references to things out across the network? I do remember having problems with libxml going off and trying to retrieve XSD from namespace based URLs and taking a long time to do it. Unfortunately I don't have a dev environment set up where I could try it so I'm guessing. Regards Simon -- Apache Tuscany committer: tuscany.apache.org Co-author of a book about Tuscany and SCA: tuscanyinaction.com
