Faster And Lighter, The Performance Test On ZK8

From Documentation
Revision as of 15:57, 20 September 2015 by Jameschu (talk | contribs)

Under Construction-100x100.png This paragraph is under construction.

DocumentationSmall Talks2015SeptemberFaster And Lighter, The Performance Test On ZK8
Faster And Lighter, The Performance Test On ZK8

Author
James Chu, Engineer, Potix Corporation
Date
September 2015
Version
ZK 8.0

Introduction

In the upcoming ZK 8, we have done a lot of performance tuning in both server side and client side. To determine the difference of performance between ZK 7 and ZK 8, we arrange a test, using MVVM and children binding to generate 30 * 30 <div>s and <label>s. Moreover, we use the new feature - Shadow element in ZK 8 to generate the same components. About the testing tools, we use JMeter to record the average response time, and VisualVM to record the memory consumption of each test case.

Test Environment

The following paragraph includes the hardware spec of this test, required software, and corresponding parameters.

  • Hardware
    • CPU: 2.9 GHz Intel Core i5
    • Memory: 16.00 GB
  • Software
    • ZK 7.0.6 CE
    • ZK 8.0.0 CE FL (20150914)
    • ZK 8.0.0 EE FL (20150914)
    • Jetty -7.6.8.v20121106
    • JDK 1.7.0.80
    • Apache JMeter 2.12
    • Visual VM 1.3.8
  • Configurations
    • Jetty
      • -Xms8096m
      • -Xmx8096m
    • JMeter
      • 100, 200, 400, 600, 800, 1000, 1200, 1500 concurrent threads in 1 second

Test Plan

There are two test cases in this performance test. First, we use children binding and MVVM to generate 30 * 30 <div>s and <label>s, and switch three versions: ZK 7.0.6 EE, ZK 8.0.0 CE, and ZK 8.0.0 EE. Second, we use the Shadow element to generate the same amount of components. Testing is done by monitoring that there are 100 to 1500 concurrent users accessing the page.

Test Case

The whole performance testing project for this article can be found in github children-binding.zul:

<?component name="wizard" templateURI="/WEB-INF/zul/template/wizard/wizard.zul" ?>
<zk>
    <div id="bind" apply="org.zkoss.bind.BindComposer"
         viewModel="@id('vm') @init('org.zkoss.ForEachVM')">
        <div id="host" style="display:none">
            <div children="@load(vm.array)">
                <template name="children">
                    <div children="@load(vm.array)">
                        <template name="children">
                            Test Label
                        </template>
                    </div>
                </template>
            </div>
        </div>
    </div>
</zk>

ForEachVM.java:

public class ForEachVM {
	private static List<Integer> array = Collections.nCopies(30, 30);
	public void setArray(List<Integer> array) {}
	public List<Integer> getArray() {
		return array;
	}
}

forEach.zul

<?component name="wizard" templateURI="/WEB-INF/zul/template/wizard/wizard.zul" ?>
<zk>
    <div id="bind" apply="org.zkoss.bind.BindComposer"
         viewModel="@id('vm') @init('org.zkoss.ForEachVM')">
        <div id="host" style="display:none">
           <forEach items="@load(vm.array)">
           <div>
               <forEach items="@load(vm.array)">
                   <div>Test Label1</div>
               </forEach>
           </div>
           </forEach>
        </div>
    </div>
</zk>

Test Result

Memory Consumption

ZK8 performance test memory consumption.png

Response Time

ZK8 performance test response time.png

Summary