Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
udo_martens
Active Contributor

Introduction


Comparing the runtime performance and stability of 6 kinds of mapping programms
is a frequently discussed theme around Netweaver / XI.
    • Message Mapping

    • Java Mapping (DOM)

    • Java Mapping (SAX)

    • XSL Styleheet in Java stack

    • ABAP Mapping (DOM)

    • XSLT running in ABAP stack


have been tested to compare capability and robustness.

Test Scenario


You will find here a short description of the test environment.
For more details have a look to the appendix.

Hardware


The Web Application Server is running WIN 2000 OS with 2 GIG RAM using 2 CPUs with ~1 GHz.

!https://weblogs.sdn.sap.com/weblogs/images/37279/SystemInformation.gif|height=321|alt=System Information|width=435|src=https://weblogs.sdn.sap.com/weblogs/images/37279/SystemInformation.gif|border=0|vspace=10!

Scenario


The message flow is quite simple.

The XI file adapter is reading a text file, tranfering it as XML to the Integration Engine.
The corresponding mapping program will be executed and the result is routed to R/3 system via RFC adapter.

!https://weblogs.sdn.sap.com/weblogs/images/37279/ComponentView.gif|height=291|alt=Component View|width=272|src=https://weblogs.sdn.sap.com/weblogs/images/37279/ComponentView.gif|border=0|vspace=10!

Mapping Task


The example was choosed as basic as possible. The file adapter converts 10 columns to fields f01 - f10.
They are disposed in repeatable field Set . The mapping result must be understoodable by the RFC adapter,
so it has to be valid for the XML schema, what was generated during import of RFC into IB Repository.
Each 'Set' is now an 'item'. f01 will be mapped to FIELD1 .

!https://weblogs.sdn.sap.com/weblogs/images/37279/MappingReqirement.gif|height=234|alt=Mapping Task|width=402|src=https://weblogs.sdn.sap.com/weblogs/images/37279/MappingReqirement.gif|border=0|vspace=10!

Test Cases



    1. Performance: Sending of 80 messages (each 0,57 MB) in modus EOIO. Taking first start time and last end time.
      The performance was tested 3 times for each mapping program. The determined runtime is an average value.

    2. Stability: Increasing the volume of single messages til appearing of runtime errors.
      Ambition was to find out volume of biggest success mesaage and smallest error message.


Results






Perfomance Test







































Mapping ProgramAverage Runtime in sec for 80 Msg (0,57 MB)Speed (MB/h)
Message Mapping209786
Java (DOM)210782
Java (SAX)208789
XSL/Java201817
ABAP (DOM)281584
XSL/ABAP184892





Stability Test







































Mapping ProgramHighest Volume (MB)
Success Messages
Lowest Volume (MB)
Error Messages
Message Mapping50,257
Java (DOM)42,850,2
Java (SAX)79,895,8
XSL/Java5771,3
ABAP (DOM)6,88,3
XSL/ABAP6,88,3



Discussion


It should be clear that these results are not representative regarding absolute performance or stability
as the results are strongly dependend from hardware parameters. The environment wasnt optimized for the tasks
especially not for mappings running in the ABAP stack (ABAP Profile / transaction RZ10).
The processing time was taken in SXMB_MONI for the whole processing at Integration Server and not only for the mapping.
Probably the mapping took the biggest part of processing time.
The tests should allow following assumptions:

    1. XLS has the best performance, what was not expectable!


Please have a look to SAP XI Library / Designing Mappings / Overview / Comparing Mapping Program Types

    1. Mappings running in the Java stack are much more stabil than mappings at ABAP stack






Appendix


R/3 Profil of WAS


!https://weblogs.sdn.sap.com/weblogs/images/37279/RZ10top.gif|height=361|alt=RZ10|width=546|src=https...!

!https://weblogs.sdn.sap.com/weblogs/images/37279/rz10bottom.gif|height=344|alt=RZ10|width=546|src=ht...!

Description of Error Messages


Message Mapping:



    1. SXMB_MONI / Status: Recorded for Outbound Processing

    2. SMQ2: SYSFAIL / TIME_OUT

    3. ST22: TIME_OUT

      The program "????????????????????????????????????????" has exceeded the maximum permitted runtime without interruption,
      and has therefore been terminated.-
      Short Dump because ABAP Profile Parameter rdisp/max_wprun_time: 600 sec


Java (DOM)



    1. SXMB_MONI / Status: Automatic Restart

    2. SMQ2: execute LUW again

    3. Java stack crashes and has to be restarted (SMICM)


Java (SAX)



    1. SXMB_MONI / Status System Error

    2. SMQ2: SYSFAIL / HTTP_RESP_STATUS_CODE_NOT_OK

    3. Java stack crashes and has to be restarted (SMICM)


XSL/Java



    1. SXMB_MONI / Status System Error

    2. SMQ2: SYSFAIL / HTTP_RESP_STATUS_CODE_NOT_OK

    3. Java stack crashes and has to be restarted (SMICM)


ABAP and XSL/ABAP



    1. SXMB_MONI / Status: Recorded for Outbound Processing

    2. SMQ2: SYSFAIL / Unable to fulfil request for 7339212 bytes of memory space.

    3. ST22: SYSTEM_NO_ROLL



Grafic Message Mapping



Source Code ABAP



Source Code XSL


Source Code Java DOM



package jMapPackage;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Map;


import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;


import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import org.xml.sax.SAXException;


import com.sap.aii.mapping.api.StreamTransformation;
import com.sap.aii.mapping.api.StreamTransformationException;


public class JMap implements StreamTransformation{


     public static void main(String[] args) throws Exception
     {
          try
          {
               FileInputStream fin =
                    new FileInputStream("C:/Dokumente und Einstellungen/UMartens/Desktop/source.xml");
               FileOutputStream fout =
                    new FileOutputStream("C:/Dokumente und Einstellungen/UMartens/Desktop/target.xml");
               JMap mapping = new JMap();
               mapping.execute(fin, fout);


          }
          catch (Exception e)          {
               e.printStackTrace();
          }
     }


public void setParameter (Map param) {}


public void execute (InputStream in, OutputStream out)
     throws com.sap.aii.mapping.api.StreamTransformationException {


          DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
          Document documentIn = null;
          DocumentBuilder builder = null;
          try {
                    builder = factory.newDocumentBuilder();
               } catch (ParserConfigurationException e1) {
                    e1.printStackTrace();
               }
          try {
               Element itemNode = null;
               NodeList[] list_f=new NodeList[10];
               Element[] field=new Element[10];
               documentIn = builder.parse(in);


               Document documentOut = builder.newDocument();
               Element rootNode = documentOut.createElementNS("urn:sap-com:document:sap:rfc:functions","ns1:Z_SAVE_XI_DATA");
               documentOut.appendChild(rootNode);
               Element tableNode = documentOut.createElement("TABLE");
               rootNode.appendChild(tableNode);


               NodeList list_Set=documentIn.getElementsByTagName("Set");
               for(int j=1;j<10;j++){
                    list_f[j-1]=documentIn.getElementsByTagName("f0"+j);
               }
            list_f[9]=documentIn.getElementsByTagName("f10");
               NodeList list_f01=documentIn.getElementsByTagName("f01");
               for (int i=0;i<list_Set.getLength();i++){
                    itemNode=documentOut.createElement("item");
                    tableNode.appendChild(itemNode);


                    for(int k=0; k<10;k++){
                         Node f=list_f[k].item(i);
                         f=f.getFirstChild();
                         String str_f=f.getNodeValue();


                         Text text_f=documentOut.createTextNode(str_f);
                         field[k]=documentOut.createElement("FIELD"(k1));
                         field[k].appendChild(text_f);
                         itemNode.appendChild(field[k]);
                    }
               }
               TransformerFactory tf = TransformerFactory.newInstance();
               Transformer transform = tf.newTransformer();
               transform.transform(new DOMSource(documentOut), new StreamResult(out));
               } catch (SAXException e2) {
                    e2.printStackTrace();
               } catch (IOException e2) {
                    e2.printStackTrace();
               }catch (Throwable t) { throw new StreamTransformationException("error", t); }
     }
}
</textarea>

Source Code Java SAX



package jMapPackage;


import java.io.FileInputStream;
import java.io.FileOutputStream;


import com.sap.aii.mapping.api.StreamTransformation;
import java.io.*;
import java.util.Map; import javax.xml.parsers.*;
import org.xml.sax.; import org.xml.sax.helpers.;


public class JMapSax extends DefaultHandler implements StreamTransformation{
     private Map map;
     private OutputStream out;
     public static void main(String[] args) throws Exception{
          try{
               FileInputStream fin =
                    new FileInputStream("C:/Dokumente und Einstellungen/UMartens/Desktop/source.xml");
               FileOutputStream fout =
                    new FileOutputStream("C:/Dokumente und Einstellungen/UMartens/Desktop/target.xml");
               JMapSax mapping = new JMapSax();
               mapping.execute(fin,fout);
          }
          catch (Exception e){
               e.printStackTrace();
          }
     }
     public void setParameter (Map param){
          map = param;
     }
     public void execute (InputStream in, OutputStream out)
     throws com.sap.aii.mapping.api.StreamTransformationException {
          DefaultHandler handler = this;
          SAXParserFactory factory = SAXParserFactory.newInstance();
          try {
               SAXParser saxParser = factory.newSAXParser();
               this.out = out; saxParser.parse(in, handler);
          }
          catch (Throwable t){
               t.printStackTrace();
          }
     }
     private void write (String s) throws SAXException{
          try{
               out.write(s.getBytes()); out.flush();
          }
          catch (IOException e){
               throw new SAXException("I/O error", e);
          }
     }
     public void startDocument () throws SAXException{
          write("");
          if(eName.substring(0,2).equals("f0"))
               write("<FIELD"eName.substring(2,3)">");
          if(eName.equals("f10"))
               write("");
          if(eName.substring(0,2).equals("f0"))
               write("</FIELD"eName.substring(2,3)">");
          if(eName.equals("f10"))
               write("</FIELD10>");
    }
     public void characters (char buf[], int offset, int len)
     throws SAXException {
          String s = new String(buf, offset, len);
          write (s);
     }
}


</textarea>
13 Comments