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 | ||||||
---|---|---|---|---|---|---|
|
Measurements
Disabling Prefix (20x20)
Read 20 childnodes x 20 grandchildren (421 fragments) | ||||
Run (#) | With Prefix (ms) | Without Prefix (ms) | Delta (ms) | |
1 | 4,182 | 2,372 | 1,810 | |
2 | 5,753 | 2,420 | 3,333 | |
3 | 4,195 | 1,789 | 2,406 | |
4 | 4,932 | 2,319 | 2,613 | |
5 | 6,613 | 1,994 | 4,619 | |
6 | 4,569 | 1,919 | 2,650 | |
7 | 4,900 | 1,729 | 3,171 | |
8 | 5,612 | 1,671 | 3,941 | |
9 | 4,119 | 2,026 | 2,093 | |
10 | 5,481 | 1,967 | 3,514 | |
(ms) | (ms) | (ms) | (%) | |
Average | 5,036 | 2,021 | 3,015 | 58.93 |
Mean | 4,978 | 2,005 | 2,904 | 58.34 |
Median | 4,916 | 1,981 | 2,911 | 57.97 |
Min Value | 4,119 | 1,671 | 1,810 | 43.28 |
Max Value | 6,613 | 2,420 | 4,619 | 70.22 |
Variation | 2,494 | 749 | 2,809 | 26.94 |
Disabling Prefix (30x50)
Read 30 childnodes x 50 grandchildren (1531 fragments) | ||||
Run (#) | With Prefix (ms) | Without Prefix (ms) | Delta (ms) | |
1 | 9,086 | 5,045 | 4,041 | |
2 | 8,848 | 4,945 | 3,903 | |
3 | 8,023 | 4,414 | 3,609 | |
4 | 7,501 | 4,212 | 3,289 | |
5 | 8,126 | 5,718 | 2,408 | |
6 | 13,652 | 5,770 | 7,882 | |
7 | 8,825 | 5,227 | 3,598 | |
8 | 8,856 | 4,624 | 4,232 | |
9 | 10,878 | 4,035 | 6,843 | |
10 | 8,207 | 4,394 | 3,813 | |
(ms) | (ms) | (ms) | (%) | |
Average | 9,200 | 4,838 | 4,362 | 46.27 |
Mean | 9,064 | 4,805 | 4,121 | 45.46 |
Median | 8,837 | 4,785 | 3,858 | 44.73 |
Min Value | 7,501 | 4,035 | 2,408 | 29.63 |
Max Value | 13,652 | 5,770 | 7,882 | 62.91 |
Variation | 6,151 | 1,735 | 5,474 | 33.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) | |
1 | 7,149 | 3,102 | 4,047 | |
2 | 6,592 | 2,954 | 3,638 | |
3 | 6,968 | 2,940 | 4,028 | |
4 | 7,410 | 3,152 | 4,258 | |
5 | 6,466 | 2,893 | 3,573 | |
6 | 7,948 | 4,242 | 3,706 | |
7 | 6,668 | 4,963 | 1,705 | |
8 | 7,445 | 3,172 | 4,273 | |
9 | 6,427 | 3,271 | 3,156 | |
10 | 6,964 | 3,216 | 3,748 | |
(ms) | (ms) | (ms) | (%) | |
Average | 7,004 | 3,391 | 3,613 | 51.48 |
Mean | 6,988 | 3,340 | 3,515 | 50.30 |
Median | 6,966 | 3,162 | 3,727 | 55.22 |
Min Value | 6,427 | 2,893 | 1,705 | 25.57 |
Max Value | 7,948 | 4,963 | 4,273 | 57.81 |
Variation | 1521 | 2070 | 2568 | 32.24 |
Native Query
Read 30 childnodes x 50 grandchildren (1531 fragments) (No Hibernate Logging, Native, Lazy Fetching) | |||
Run (#) | Before (ms) | After (ms) | |
1 | 7,149 | 481 | |
2 | 6,592 | 592 | |
3 | 6,968 | 673 | |
4 | 7,410 | 421 | |
5 | 6,466 | 911 | |
6 | 7,948 | 682 | |
7 | 6,668 | 572 | |
8 | 7,445 | 537 | |
9 | 6,427 | 795 | |
10 | 6,964 | 309 | |
(ms) | (ms) | (%) | |
Average | 14,474 | 597 | 516.89 |
Mean | 14,301 | 573 | |
Median | 13,013 | 582 | |
Min Value | 12,514 | 309 | |
Max Value | 19,620 | 911 | |
Variation | 7,106 | 602 |
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) | |
1 | 6,275 | 2,402 | 3,873 | |
2 | 5,812 | 2,437 | 3,375 | |
3 | 5,738 | 2,357 | 3,381 | |
4 | 5,773 | 2,472 | 3,301 | |
5 | 5,720 | 2,751 | 2,969 | |
6 | 6,104 | 2,205 | 3,899 | |
7 | 5,841 | 2,395 | 3,446 | |
8 | 6,191 | 2,891 | 3,300 | |
9 | 6,259 | 2,909 | 3,350 | |
10 | 7,445 | 4,240 | 3,205 | |
(ms) | (ms) | (ms) | (%) | |
Average | 6,116 | 2,706 | 3,410 | 56.05 |
Mean | 6,098 | 2,659 | 3,400 | 55.75 |
Median | 5,973 | 2,455 | 3,363 | 57.62 |
Min Value | 5,720 | 2,205 | 2,969 | 43.05 |
Max Value | 7,445 | 4,240 | 3,899 | 63.88 |
Variation | 1,725 | 2,035 | 930 | 20.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) | |
1 | TBC | 71,238 | |
2 | TBC | 54,571 | |
3 | TBC | 56,730 | |
(ms) | (ms) | (%) | |
Average | 60,846 | 292 | 909.68 |
Mean | 60,417 | 277 | |
Median | 56,730 | 247 | |
Min Value | 54,571 | 202 | |
Max Value | 71,238 | 426 | |
Variation | 16,667 | 224 |
Improvements Overview (averages)
Read 30 childnodes x 50 grandchildren (1,531 fragments)
# | Improvement | Before (ms) | After(ms) | Gain (%) | Gain (x) |
---|---|---|---|---|---|
1 | Remove prefix lookup in Query | 9,200 | 4,838 | 47 | 1.9x |
2 | Disabled Hibernate Logging | 4,838 | 3,391 | 30 | 1.4x |
3 | Fetch strategy changed to Eager (was Lazy) * | 3,391 | 2,706 | 20 | 1.2x |
4 | Native Query (Joe's laptop) | 3,391 | 597 | 83 | 5.7x |
5 | Native Query (Toine's laptop 40x50) | ~1,600 | ~80 | 95 | 20.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) |
---|---|---|---|---|---|
1 | Fetch strategy changed to Eager | 14,474 | 60,846 | -320% | 0.23x |
Laptop Performance Comparison
Setup (ms) | Avg(ms) | Read (ms) | Avgs(ms) | O.S. | Memory | Processor | |
---|---|---|---|---|---|---|---|
Toine | 5129, 4702, 5416 | 2403, 2402, 2432 | Win11 | 32 | i7 2.60Ghz | ||
Priyank | 7866, 5574, 5738 | 3108, 2870, 2857 | Win10 | 32 | i5 2.50GHz | ||
Luke | 5849, 5581, 5489 | 3010, 2912, 2963 | Win10 | 32 | i7 2.60GHz | ||
CI ONAP | 2437 | 2437 | 1172 | 1172 | Ubuntu | ||
CI Nordix | 2095 |