users@glassfish.java.net

About the performance in initial context betwwen multi-thread and single thread(glassfish v3)

From: lvsongping <lvsongping_at_cn.fujitsu.com>
Date: Fri, 28 Mar 2014 10:45:30 +0800

Hi, GF dev team:

 

    Currently, I have a question about the performance of lookup the JNDI
name in glassfish v3. Here's the reduced steps about my questions:

1). Develop a Java SE application used to test the performance of lookup the
JNDI name(You can use application I have attached in this mail).

 

2). Before you ran the Java class, you should start the glassfish at first.

 

3). java -classpath ".;%CLASSPATH%;appserv-rt.jar;javaee.jar" JNDITest

initial context complete, use time : 2306 millisecond.

start lookup.

lookup complete, use time : 575 millisecond.

 

4). However, if we decide to lookup JDNI name in muli-thread, it will take
much more time to lookup JNDI name in each thread than lookup JDNI name in
single thread.You can execute the batch application I have attached here to
test the performance of lookup the JNDI name in multi-thread.

 

5). Run the test.bat, you will found every thread will take more than 5000
millisecond in initial context:

initial context complete, use time : 5986 millisecond.

start lookup.

lookup complete, use time : 718 millisecond.

 

Above all, Could anyone illustrate why it will take much more time to lookup
JNDI name in each thread under the multi-thead situation than lookup JDNI
name in single thread?

 

BTW, my environment as follows:

OS: Win 7

JDK version; JDK1.7

GLASSFISH: glassfish v3

 

Thanks

 

Regards

Jeremy Lv

--------------------------------------------------

Lv Songping

Software Division II

    Development Department I

Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)

ADDR.: No.6 Wenzhu Road, Software Avenue,

        Nanjing, 210012, China

TEL : +86+25-86630566-9327

COINS: 7998-9327

FAX : +86+25-83317685

MAIL : <mailto:lvsongping_at_cn.fujitsu.com> lvsongping_at_cn.fujitsu.com

BLOG : <https://www.java.net/author/jeremy-lv>
https://www.java.net//author/jeremy-lv