You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by Wing Chu <wc...@bea.com> on 2004/10/21 02:15:30 UTC

XMLBeans Performance Tuning

Hi experts,

 

In our schemas we have the following as part of a larger XML schema,

 

<xs:simpleType name="CurrencySymbol">

      <xs:annotation>

         <xs:documentation>CurrencySymbol</xs:documentation>

      </xs:annotation>

      <xs:restriction base="xs:NMTOKEN">

         <xs:enumeration value="USD"/>

         <xs:enumeration value="CAD"/>

         <xs:enumeration value="EUR"/>

         <xs:enumeration value="JPY"/>

         <xs:enumeration value="GBP"/>

      </xs:restriction>

   </xs:simpleType>

 

Then we of course import this into WebLogic Workshop and it creates an
XML Bean.

We then do the following in java.

 

xmlMoneyAmount.setCurrency(CurrencySymbol.Enum.forString(jdoMoneyAmount.
getCurrency().getEnumValue()));

 

 

where xmlMoneyAmount is the XMLBean.  We have also defined the following

 

public class MoneyAmountJDO implements  java.io.Serializable {

   private com.bea.domain.datatypes.CurrencySymbolEnum currency;

   public com.bea.domain.datatypes.CurrencySymbolEnum getCurrency()

   {

      return currency;

   }

...

}

 

public class CurrencySymbolEnum implements java.io.Serializable {

   private final String value;

   public String getEnumValue()

   {

        return value;

   }

...

}

 

We are seeing 4-5ms being taken on this one line of java which is at
least 4-5x the time it takes other XML Bean store operations.  We are
seeing this on all the enumerations we have defined.  It appears that
there is some sort of slowness of the EnumForString function of the
XMLBean.  Any help would be appreciated.

 

Thanks,

Wing