Author |
Message
|
Jakob_CPH |
Posted: Thu Feb 23, 2006 5:28 am Post subject: Performance and ESQL string operations |
|
|
Apprentice
Joined: 28 Jan 2005 Posts: 26
|
Hi,
I have a few questions about ESQL string operations and performance:
1) Is there documentation regarding this subject?
2) Is it better to use LEFT instead of SUBSTRING
3) When using POSITION should the string I am looking for be as long as possible (is it better to look for '##TAG100' instead of 'TAG100').
4) is LENGHT expensive for large strings (60K)
5) could the code below be improved?
gds is a string of char 200K, hex2 contain X'02'
Code: |
WHILE length(gds) > 30000 do
SET endPos = POSITION(hex2 IN SUBSTRING(gds FROM 1 FOR 30000) REPEAT -1);
SET Environment.gds[messageNumber] = SUBSTRING(gds FROM 1 FOR endPos) ;
SET gds = SUBSTRING(gds FROM endPos + 1 ) ;
SET messageNumber = messageNumber + 1;
END WHILE;
|
Thanks
Jakob |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 23, 2006 8:19 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
How many messages a second do you need to process?
What hardware is your broker running on?
Can you run your flow with multiple occurances? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
javaforvivek |
Posted: Thu Feb 23, 2006 9:26 pm Post subject: |
|
|
 Master
Joined: 14 Jun 2002 Posts: 282 Location: Pune,India
|
For all your questions -
Go through the ESQL manual for developing ESQL - Click Here for the ESQL Reference. I assume that you are working on v6 and not v5. _________________ Vivek
------------------------------------------------------
...when you have eliminated the impossible, whatever remains, however improbable, must be the truth. |
|
Back to top |
|
 |
Jakob_CPH |
Posted: Fri Feb 24, 2006 12:38 am Post subject: |
|
|
Apprentice
Joined: 28 Jan 2005 Posts: 26
|
Thnaks for your replies.
I use z/OS as platform, that is why the performance is importent for the customer. I have not yet migrated to v6 so I am still using v5.
The ESQL manual describes how to use the function but not how the are implemeted/ how expencive they are. Fx is Boyer-Moore used by the POSITION function.
Thanks |
|
Back to top |
|
 |
fschofer |
Posted: Fri Feb 24, 2006 1:16 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
Hi,
Quote: |
5) could the code below be improved? |
some ideas from me
Code: |
WHILE length(gds) > 30000 do
SET endPos = POSITION(hex2 IN SUBSTRING(gds FROM 1 FOR 30000) REPEAT -1);
...
SET gds = SUBSTRING(gds FROM endPos + 1 ) ; |
I would use several Pos variables to search inside parts of the whole string and avoid to SET gds each time. I think the mem copy is expensive.
Maybe also a REPEAT - "X" could be useful.
Code: |
SET Environment.gds[messageNumber] = SUBSTRING(gds FROM 1 FOR endPos) ; |
Use REFERENCE + CREATE LASTCHILD instead of array index
Greetings
Frank |
|
Back to top |
|
 |
|