Re: DataQueue performance jt400Native 10x slower then RPG

[email protected]
Newsgroups gmane.comp.lang.as400.java
Message-ID <OF22BF8C15.0C4FE6F2-ONC1258546.005CD40B-C1258546.005CF1E9@encobis.com>
Below you can see the java code of the slower server. you can see that ist 
runs all the time and mesures ever strem of 1024 msgs from the client. the 
client numbers the msgs from 1 to 1024

package test;

import com.ibm.as400.access.*;

public class TestDataQueue {

        public void run() throws Exception {
                AS400 as400 = new AS400();
 
                System.err.println(as400.getSystemName() + " " + 
as400.canUseNativeOptimizations() + " " + as400.getImpl() + " " + 
as400.isMustUseSockets() + " " + as400.isMustUseNetSockets());

                BinaryFieldDescription tv_sec = new 
BinaryFieldDescription(new AS400Bin4(), "SEC");
                BinaryFieldDescription tv_usec = new 
BinaryFieldDescription(new AS400Bin4(), "USEC");
                BinaryFieldDescription nr = new BinaryFieldDescription(new 
AS400Bin4(), "NR");

                RecordFormat dataFormat = new RecordFormat();

                dataFormat.addFieldDescription(tv_sec);
                dataFormat.addFieldDescription(tv_usec);
                dataFormat.addFieldDescription(nr);

                DataQueue dq = new DataQueue(as400, 
"/QSYS.LIB/EDEV.LIB/DTAQ3.DTAQ");
 
 
                long ts = System.currentTimeMillis();
                while(true) {
 
                        DataQueueEntry dqe = dq.read(-1);
 
                        Record data = 
dataFormat.getNewRecord(dqe.getData());
 
                        int nx = (Integer) data.getField("NR");
 
                        // when forst of the 1024 msgs reset timing
 
                        if (nx == 1) {
                                ts = System.currentTimeMillis();
                        }
 
                        if (nx == 1024) {
                                System.err.println("done: " + nx + " " + 
(System.currentTimeMillis() - ts));
                        }
                }
        }

        public static void main(String[] args) {
                try {
                        new TestDataQueue().run();
                } catch (Exception e) {
                        e.printStackTrace();
                }

        }
}







From:   [email protected]
To:     [email protected]
Date:   10.04.2020 17:35
Subject:        DataQueue performance jt400Native 10x slower then RPG
Sent by:        "JAVA400-L" <java400-l-bounces-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org>



Hi!

I have a performance problem with my IBM-i scenario.

I have a RPG Client which writes messages to a dataquene. the messages are 

about 9000bytes in size. i am writing 1024 messages.

I have two server implementaions which run on the same IBMi machine one in 

Java and one in RPG

The java version takes about 150ms to read 1024 messges. The RPG version 
only about 15ms. so the RPG version is 10 times faster.

I verified that i user jt400Native and the AS400ImplNative and 
BaseDataQueueImplNative is used so that the native API calls from JVM/Pase 

are used.

Both server implementations are running in al loop so that i can exlude 
any startup perfomance impacts. The timings do not vary over time. RPG is 
alwas 10x faster.


Why is the Java/Pase version so much slower??

Greetings,
Franz

My Environment is: Power S812 64GB RAM (1Core no VIOS). IBM-i 7.4 TR1. 
There is no load on Server


-- 
This is the Java Programming on and around the IBM i (JAVA400-L) mailing 
list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives
at https://archive.midrange.com/java400-l.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com



-- 
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives
at https://archive.midrange.com/java400-l.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.