Performance Pitfall / Warning

Performance Pitfall / Warning

Postby nl059810 on Sun Jan 27, 2013 4:24 pm

Situation: A script that used to run with Easycom's Toolkit is changed to run with db2* sql AND the Compatibility Wrapper.

After changing the code (db2 data access a few i5 functions like i5_data_area_read remained) the performance was not acceptable.

Db2 and the CW share a connection ([url]forums.zend.com/viewtopic.php?f=113&t=46688&p=115128&hilit=share+connection#p115128[/url])

The result of the sql instruction are a few hundred rows, which should take about 4 seconds to display in the browser.
Within the loop a data area is read (i5_data_area_read). So that is also executed a few hundred times. This was no problem with easycom toolkit, but has a huge performance impact when combining db2 with the CW. In this case I was able to change the code (data area access outside the loop), which brought the roundtrip of the script back from 40(!!!!) Seconds to an acceptable 4 seconds.

Conclusion: avoid calling CW functions in a db2 sql selection loop......
Henri Timmermans, Software Engineer at FH Holding BV
Internet : http://www.exa-holding.com
LinkedIn: http://www.linkedin.com/pub/henri-timmermans/14/b39/236
nl059810
 
Posts: 13
Joined: Thu Sep 03, 2009 10:29 pm

Re: Performance Pitfall / Warning

Postby rangercairns on Wed Feb 06, 2013 5:25 pm

Yeah ... i5_data_area_ read uses RTVDTAARA, which is xmlservice through rexx in/out commands (slow). Personally, i would toolkit directly at programming API with PgmCall for speed ... and/or ... MAYBE chat Alan into doing a change Toolkit and CW.
Code: Select all
Retrieve Data Area (QWCRDTAA) API
Required Parameter Group:
1 - Receiver variable -- Output Char(*)
2 - Length of receiver variable -- Input Binary(4)
3 - Qualified data area name -- Input Char(20)
4 - Starting position -- Input Binary(4)
5 - Length of data -- Input Binary(4)
6 - Error code -- I/O Char(*)
rangercairns
 
Posts: 216
Joined: Fri Jul 24, 2009 6:28 pm

Re: Performance Pitfall / Warning

Postby aseiden on Fri Feb 08, 2013 9:39 pm

Ranger is correct. We could speed up data area reads by using the QWCRDTAA API. I'm not promising anything yet, but I'll look into it when I investigate the *LDA bug (the toolkit shouldn't qualify *LDA with a library) and the *CURLIB/*LIBL question that someone raised.

Thanks for all the feedback.

Alan
aseiden
 
Posts: 829
Joined: Thu Apr 09, 2009 5:45 pm

Re: Performance Pitfall / Warning

Postby aseiden on Tue Mar 19, 2013 5:37 pm

Performance improvement in data area reads in 1.5.0:
http://174.79.32.155/wiki/uploads/XMLSE ... -1.5.0.zip

--Alan
aseiden
 
Posts: 829
Joined: Thu Apr 09, 2009 5:45 pm


Return to New Toolkit

Who is online

Users browsing this forum: No registered users and 2 guests