Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

The purpose of this spike is to determine over a number of iterations which approach yields the best results for performance gain. 

Ref. 

Jira
serverONAP Jira
serverId425b2b0a-557c-3c0c-b515-579789cceedb
keyCPS-1171

Measurements

Disabling Prefix (20x20)

Read 20 childnodes x 20 grandchildren (421 fragments)
Run  (#)With Prefix (ms)Without Prefix (ms)Delta (ms)
14,1822,3721,810
25,7532,4203,333
34,1951,7892,406
44,9322,3192,613
56,6131,9944,619
64,5691,9192,650
74,9001,7293,171
85,6121,6713,941
94,1192,0262,093
105,4811,9673,514


(ms)(ms)(ms)(%)
Average5,0362,0213,01558.93
Mean4,9782,0052,90458.34
Median4,9161,9812,91157.97
Min Value4,1191,6711,81043.28
Max Value6,6132,4204,61970.22
Variation2,4947492,80926.94


Disabling Prefix (30x50)

Read 30 childnodes x 50 grandchildren (1531 fragments)
Run  (#)With Prefix (ms)Without Prefix (ms)Delta (ms)
19,0865,0454,041
28,8484,9453,903
38,0234,4143,609
47,5014,2123,289
58,1265,7182,408
613,6525,7707,882
78,8255,2273,598
88,8564,6244,232
910,8784,0356,843
108,2074,3943,813


(ms)(ms)(ms)(%)
Average9,2004,8384,36246.27
Mean9,0644,8054,12145.46
Median8,8374,7853,85844.73
Min Value7,5014,0352,40829.63
Max Value13,6525,7707,88262.91
Variation6,1511,7355,47433.27



Disabling logging

Read 30 childnodes x 50 grandchildren (1531 fragments) (No Hibernate Logging with Lazy Fetching)
Run (#)With Prefix (ms)Without Prefix (ms)Delta (ms)
17,1493,1024,047
26,5922,9543,638
36,9682,9404,028
47,4103,1524,258
56,4662,8933,573
67,9484,2423,706
76,6684,9631,705
87,4453,1724,273
96,4273,2713,156
106,9643,2163,748






(ms)(ms)(ms)(%)
Average7,0043,3913,61351.48
Mean6,9883,3403,51550.30
Median6,9663,1623,72755.22
Min Value6,4272,8931,70525.57
Max Value7,9484,9634,27357.81
Variation15212070256832.24


Native Query

Read 30 childnodes x 50 grandchildren (1531 fragments) (No Hibernate Logging, Native, Lazy Fetching)
Run  (#)Before (ms)After (ms)
17,149481
26,592592
36,968673
47,410421
56,466911
67,948682
76,668572
87,445537
96,427795
106,964309





(ms)(ms)(%)
Average14,474597516.89
Mean14,301573
Median13,013582
Min Value12,514309
Max Value19,620911
Variation7,106602


Using Eager Fetching

Read 30 childnodes x 50 grandchildren (1531 fragments) (No Hibernate Logging with Eager Fetching)
Run (#)With Prefix (ms)Without Prefix (ms)Delta (ms)
16,2752,4023,873
25,8122,4373,375
35,7382,3573,381
45,7732,4723,301
55,7202,7512,969
66,1042,2053,899
75,8412,3953,446
86,1912,8913,300
96,2592,9093,350
107,4454,2403,205






(ms)(ms)(ms)(%)
Average6,1162,7063,41056.05
Mean6,0982,6593,40055.75
Median5,9732,4553,36357.62
Min Value5,7202,2052,96943.05
Max Value7,4454,2403,89963.88
Variation1,7252,03593020.83


Test setup (writing data) Lazy v. Eager

Insert 30 childnodes x 50 grandchildren (1531 fragments) (Lazy v. Eager Fetching)
Run  (#)Lazy (ms)Eager (ms)
1TBC71,238
2TBC54,571
3TBC56,730





(ms)(ms)(%)
Average60,846292909.68
Mean60,417277
Median56,730247
Min Value54,571202
Max Value71,238426
Variation16,667224


Improvements Overview (averages)

Read 30 childnodes x 50 grandchildren (1,531 fragments)

#

Improvement

Before (ms)

After(ms)

 Gain (%)

Gain (x)
1Remove prefix lookup in Query9,2004,838471.9x
2Disabled Hibernate Logging4,8383,391301.4x
3Fetch strategy changed to Eager (was Lazy) *3,3912,706201.2x
4Native Query (Joe's laptop)3,391597835.7x
5Native Query (Toine's laptop 40x50)~1,600~809520.0x

* 'Eager' gave some improvement on read where we needed all data but it was obvious that the test setup inserting data was negatively affected. When measured by a factor of about 320% i.e 4x slower! 

Setup (write data): 30 childnodes x 50 grandchildren (1,531 fragments)

#

Improvement

Before (ms)

After(ms)Gain (%)Gain (x)
1Fetch strategy changed to Eager14,47460,846-320%0.23x


Laptop Performance Comparison

Test run: https://gerrit.onap.org/r/c/cps/+/131463/4/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsToDataNodePerfSpec.groovy

NameSetup (ms)Avg(ms)Read (ms)Avgs(ms)O.S.Memory (Gb)ProcessorCores/Threads?
Toine5129, 4702, 54165,0822403, 2402, 24322,412Win 1132i7 2.60Ghz6/12
Priyank7866, 5574, 57386,3933108, 2870, 2857

2,945

Win 1032i5 2.50GHz4/8
Luke5849, 5581, 54895,6403010, 2912, 29632,962Win 1032i7 2.60GHz6/12
Joe23395, 26147, 1969623,07911255, 12557, 1579513,202Win 1020i5 2.50GHz2/4
Sourabh4964, 4896, 4936

4,932

2483, 2396, 24742,451Win 1140i5 2.40GHz4/8
Levente2171, 2331, 22582,2532116, 2086, 20952,099Linux Zorin OS 1631i7 1.90 GHz4/8
Andras2510, 1664, 16641,9462533, 1651, 25372,240Linux Zorin OS 1631i7 1.80 GHz4/8
CI Nordix1976, 1845

1,910

2095, 1824

1,960

Linux Ubuntu 180484-Core
CI ONAP1785, 1646

1,716

1172, 1378, 12421,264Linux Centos 788-Core