Analysis and solution for the performance issue Testlink1.7

The release related discussions, plans and questions.
Locked
lshiva86
Advanced user
Posts: 20
Joined: Mon Sep 15, 2008 5:52 am

Analysis and solution for the performance issue Testlink1.7

Post by lshiva86 »

I have been working on Testlink 1.7 performance issue. I analysed all the functions used and did some changes in the way the data was fetched in these functions. Initially for 2000 test cases it was taking 30 sec. Now it loads in 3 sec. Whenever we had more than 1000 test cases performance issue was there in
1)Execute test cases
2)Add test cases
3)Remove test cases
4)Assign test cases execution

With the changed code and sql, i could also apply pagenation. This has drastically improved performance. I would like to contribute the code to the community. Can you please tell me how i should do it? Can it also be considered for Testlink 1.8?
lshiva86
Advanced user
Posts: 20
Joined: Mon Sep 15, 2008 5:52 am

Analysis

Post by lshiva86 »

The issue in the current working of execution side of Testlink 1.7 as analysed by me is as follows:

When we click on a testsuite in a testplan having 1000 test cases,

1)Function get_linked_tcversions will get all the test cases present in the testplan (here 1000 test cases)

2)Function gen_spec_view:
a) will get all the test cases present under that test suite in that testproject. (lets say there are 2000 test cases under that test suite in the repository but only 1000 are added to testplan)
b)will compare each one of them against the test cases got by get_linked_tcversions and eliminate those which are not present in the testplan.

This comparision will be done 2000(repository test cases) * 1000( get_linked_tcversions) times . I saw this was a major bottle neck.

Secondly, the next bottle neck was get_subtree is written in a recursive way to get test cases from the repository and hence pagenation at database level cannot be applied. So no pagenation and getting all the 1000 test cases at once from database into memory was another bottleneck.

I have made an attempt to solve this. It is working fine in our company. If i can contribute it i will be very happy.

Thank you so much,
cheers to test link team, testlink 1.7 is truly a fantastic tool!

Lakshmi,
Symphony Services, Bangalore.
agarg2
Advanced user
Posts: 26
Joined: Thu Aug 02, 2007 3:49 pm

Post by agarg2 »

Awesome. If possible, could you please share the code with me? I would like to try this at my set-up.

Regards,
Arun Garg
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Post by fman »

some of this finding has been done by one of our team members that is working hard to improve performance on 1.8

regarding get_subtree(), there is no other way that work with recursion
becuase tree with N-levels depth need this kind of approach.
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Post by fman »

second solution applied on 1.8 was to disable by default while in execution
feature, get all tests cases under a test suite if you click on tree on test suite.
on 1.8 default is NOTHING HAPPENS on left frame.
You clik on EVERY TEST CASE you wnat to execute, and you execute one at a time.
This increase a lot performance.
surelly improve code also will help

my suggestion -> migrate to 1.8 (has ajax tree on test spec -> better performance). get last code from CVS or nigthly tarballs NOT form source forge 1.8. beta 3

regards
lshiva86
Advanced user
Posts: 20
Joined: Mon Sep 15, 2008 5:52 am

Post by lshiva86 »

Hi fman,

I did try Testlink1.8 but dint find any significant improvements in performance even with ajax tree :cry: :cry: . I will try this latest code as well. Since I dint find any solution i tried to give it a try to solve.

And get_subtree recursive function can be avoided by using repetitive function calls in a loop. At every function call we can store the data fetched in a php variable so this wont burden stack as in recursive function. After fetching these ids i gave them in a where clause in the sql which fetches the linked_tcversions. This automatically got all details of only the test cases in the testplan eliminating the comparision of data totally.

Please correct me if i am wrong in this.
lshiva86
Advanced user
Posts: 20
Joined: Mon Sep 15, 2008 5:52 am

Post by lshiva86 »

I am just providing appropriate comments for the code i have written. I will finish it and post as soon as possible. [/quote][/url][/code]
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Post by fman »

please check forum because other have test ajax tree with good results.
Attention:
ajax tree do not improve execution tree, but test project tree
agarg2
Advanced user
Posts: 26
Joined: Thu Aug 02, 2007 3:49 pm

Post by agarg2 »

Please share the code with me once you are done with your changes.

Regards,
Arun Garg
lshiva86
Advanced user
Posts: 20
Joined: Mon Sep 15, 2008 5:52 am

Post by lshiva86 »

Hi,

I have posted the code in mantis long back. If you have an id on tracker you can access this link http://www.testlink.org/mantis/view.php?id=1824. Else, we need to wait till testlink community people put it on user contribution.

In the link provided above, there are instructions as to how the changes need to be done. Also, upload.zip contains the code and a document describing the analysis is also uploaded.

If you need anything else, do ask me. Thank you! :)
agarg2
Advanced user
Posts: 26
Joined: Thu Aug 02, 2007 3:49 pm

Post by agarg2 »

Got it from Mantis. Thanks a lot.
Locked