Skip to Content

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 f01f10.
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 Program Average Runtime in sec for 80 Msg (0,57 MB) Speed (MB/h)
Message Mapping 209 786
Java (DOM) 210 782
Java (SAX) 208 789
XSL/Java 201 817
ABAP (DOM) 281 584
XSL/ABAP 184 892


Stability Test


Mapping Program Highest Volume (MB)
Success Messages
Lowest Volume (MB)
Error Messages
Message Mapping 50,2 57
Java (DOM) 42,8 50,2
Java (SAX) 79,8 95,8
XSL/Java 57 71,3
ABAP (DOM) 6,8 8,3
XSL/ABAP 6,8 8,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://weblogs.sdn.sap.com/weblogs/images/37279/RZ10top.gif|border=0|vspace=10!

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

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


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>

To report this post you need to login first.

13 Comments

You must be Logged on to comment or reply to a post.

    1. Udo Martens Post author
      Hi Bhavesh,

      thx 4 the suggestion. Indeed it would be an interesting test, i’m thinking about extending the blog.

      Regards,
      Udo

      (0) 
  1. Tobias Trapp
    Hi Udo,

    I was very surprised – I would expect better results for XSLT under ABAP. In fact I was able to handle much bigger files.

    It would be interesting to know about your system profiles because internal modes in the ABAP stack can be huge so there should be no problems. On the other hand the same problems can occur under Java because the virtual machine limits the size of the heap and of every thread.

    From a theoretical point of view another experiment would be interesting. In fact your transformation was very simple so I guess you could deserialize it into a corresponding ABAP-structure and serialize it using tt:copy. In fact transforming forth and back is a little bit weird but I guess it could be faster 😉

    Regards,
    Tobias

    (0) 
    1. Udo Martens Post author
      Hi Tobias,

      Thx for your notes. I will add a sceen shot from RZ10 to the blog.

      I would embrace to have some data about your experiances. Which volume could your system handle? Which hardware did you use and how did you configure the profile?

      If you send me (udo.martens@global-e-net.de) the source code for your mapping recommendation i will test it under same conditions 😉

      Best Regards,
      Udo

      (0) 
    2. Udo Martens Post author
      Hi Tobias,

      Thx for your notes. I will add a sceen shot from RZ10 to the blog.

      I would embrace to have some data about your experiances. Which volume could your system handle? Which hardware did you use and how did you configure the profile?

      If you send me (udo.martens@global-e-net.de) the source code for your mapping recommendation i will test it under same conditions 😉

      Best Regards,
      Udo

      (0) 
  2. Amol Joshi
    If you would try this with a complex structure, say even with 3/4 level deep structures, I am sure your results will show something different, rather XSLT will be the worst performer in that case.

    Regards,
    Amol

    (0) 
    1. I don’t agree on this, because it depends on the structure of the inputdata (do you have header and item data for instance or not) and the way you are looping on this data. Furthermore it depends on the fact if you are using context changes in your message mapping or not!
      (0) 
  3. Michal Krawczyk
    Hi,

    if you’re thinking about part 2
    of this weblog
    maybe you can also include tests
    with and without BPM ? 🙂
    to see which mappings work with BPM ?
    or maybe you’d have the same results as without a BPM 🙂

    Regards,
    michal

    (0) 
    1. Michal Krawczyk
      when I talka about BPM I mean to compare
      transformation step in BPM
      with mapping without BMP

      to see it any kind of mapping
      has some negative impact when done in a BPM 🙂

      Regards,
      michal

      (0) 
  4. Alwin van de Put
    Hello Udo,

    Thanks for your weblog. Every XI consultant wants to know which mapping program is the best to use, but nobody knows.

    Could you also do a zero test and measure how long this takes? By a zero test means a test without a mapping program.

    What I do not understand is your second assumption:
    “Mappings running in the Java stack are much more stabil than mappings at ABAP stack”

    because you also mentioned:
    “…environment wasnt optimized for the tasks especially not for mappings running in the ABAP stack”

    I think the ABAP stack is more stable than Java, because the ABAP stack generates readable error messages and does not crash like the Java engine. And better configuration of the ABAP environment results in transforming bigger files on the ABAP stack.

    Kind regards,
    Alwin van de Put

    (0) 
  5. Pavan Y
    Hi,
    This is very interesting blog comparing different mapping techniques performance. Could you let me know what is the difference between # XSL Styleheet in Java stack mapping & XSLT running in ABAP stack.
    Can we implement XSLT mapping in two different ways ? or is that if we use java functions in XSL mapping  it will be executed on Java stack and if we don’t use any java functions it will be executed on ABAP stack ? Please let me know.
    Congrats for this nice blog.
    Thanks
    Sudhakar.
    (0) 
  6. Daniel King
    Udo–

    Excellent work.  Was your testing on 3.0 or 7.0?  What Support Package Stack?

    Your system did not have enough RAM to follow SAP’s latest recommended JVM settings for a 64-bit system, so the data you collected about the largest messages you could process is actually on the low side.

    Your audience might be interested to know that we recently performed similar benchmarking tests on a 64-bit system with 2GB Java heaps, and similar lack-of-optimization of the ABAP stack.

    We only tested the GUI Message Mapping, and were routinely successful with 120MB message sizes in a file-to-file scenario (140MB failed).  The large-message queues built-in to the system also successfully throttled the load to the Java engine to prevent out-of-memory crashes even when dozens of such messages were sent at the same time.

    We tested on 7.0 SPS 12.

    –Dan King
    SAP NetWeaver Integration Architect, Capgemini
    daniel.king@capgemini.com

    (0) 
  7. William Li
    Hi,
    Nice job on the benchmarks.  An implication from the tests was that ABAP XSL might be the most efficient.  It is possible that as message size increases, XSL performance decreases, since several copies of the message will have to be kept in memory during mapping.

    Also, more complex mapping might also effect performance.

    Regards,
    Bill

    (0) 

Leave a Reply