<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Seeking performance for multiple calls in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/seeking-performance-for-multiple-calls/m-p/7508407#M1559250</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;quite hard to give you an answer here ... since you experience peformance "problems" on that level or want to optimize on that level it can be difficult to see significant improvements. On the other side we can congratulate you if you don't have any&lt;/P&gt;&lt;P&gt;other problems on other levels &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; (sql, internal tables, ...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.) Generally speaking you should make sure to pass your data per reference (avoid copy costs). &lt;/P&gt;&lt;P&gt;2.) Generally speaking you should keep the number of calls as small as possible (modularize don't atomize)&lt;/P&gt;&lt;P&gt;3.) Generally speaking local calls (performs, call methods in local classes or instances, function calls to one function group) should be faster than global calls (external performs, call methos in global classes or instances, function calls in other funciton groups) (not sure if this is true any more.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4.) Some years ago i learned the performs are faster than methods or function modules but i'm not sure whether this is true with current releases. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5.) I suppose you have to meassure it yourself if you want to find it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i would double check 1 and 2... reg. 3 - 5 I'm afraid you you have to do your own test. If you do so, please&lt;/P&gt;&lt;P&gt;share your results with us.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Dec 2010 13:16:00 GMT</pubDate>
    <dc:creator>HermannGahm</dc:creator>
    <dc:date>2010-12-16T13:16:00Z</dc:date>
    <item>
      <title>Seeking performance for multiple calls</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/seeking-performance-for-multiple-calls/m-p/7508404#M1559247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Xperts,&lt;/P&gt;&lt;P&gt;during the loading of data into BW it occasionally happens that certain fields contain non allowed characters. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have set up a set of rules for dealing with these characters, but now the question is how to code it from an ABAP point of view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logic is that the coding will be called from a user exit and compare the load string with a string of allowed characeters (filled over SAP FM 'RSKC_ALLOWED_CHAR_GET'). Not allowed characters in the load string will either: &lt;/P&gt;&lt;P&gt;a. be replaced with _ or&lt;/P&gt;&lt;P&gt;b. deleted or&lt;/P&gt;&lt;P&gt;c. dealt with in some more complex way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The implemented solution must include all three alternatves.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Due to the coding being called for each record (many 000, even million times) performance is of utmost importance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The identified alternatives are:&lt;/P&gt;&lt;P&gt;A. calling a method in a class passing the load string as a parameter (where the string with allowed characters is a static attribute filled once). This is our preferred alternative since it agrees with our general ABAP architecture.&lt;/P&gt;&lt;P&gt;B. calling a function module passing the load string as a parameter (where the string with allowed characters is a top-include variable filled once).&lt;/P&gt;&lt;P&gt;C. add the logic in an include &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any other reasonable alternative?&lt;/P&gt;&lt;P&gt;From a performance point of view what is the best and what are the perormance pros and cons of each?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Dec 2010 11:29:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/seeking-performance-for-multiple-calls/m-p/7508404#M1559247</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-14T11:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking performance for multiple calls</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/seeking-performance-for-multiple-calls/m-p/7508405#M1559248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;well, this might violate rules of structured programming, but since your going to&lt;/P&gt;&lt;P&gt;call it millions of times it might be worth to check, what the cost for passing the string as&lt;/P&gt;&lt;P&gt;a parameter is against using a global variable (do not hit me for that &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; .&lt;/P&gt;&lt;P&gt;I know one should avoid these, unless you have a good reason, but this may be one...I'd do measurement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What type of comparison are you doing? unicode or non-unicode ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are the "invalid" chars beside our "out of the middle" from a typical char-range that might be valid.&lt;/P&gt;&lt;P&gt;I mean, it might be worth to first check for a VALID range if this is true frequently and therefore&lt;/P&gt;&lt;P&gt;do the special checks only if it is an unusual case, allthough it might be a more expensive check in this case then.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;20 chars to check with A...Z beinig valid for 70% of the typical chars and "äöüÄÖÜ" the ones to eliminate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So 14 from 20 chars average will be A...Z the rest might be numbers or specialchars or the ones to process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) You could go 20 times check against 6 chars = 120 equal comparisons.&lt;/P&gt;&lt;P&gt;b) You could do 14 times a "&amp;gt;= A and &amp;lt;=Z" = 28 comparisons (true) and stop for those&lt;/P&gt;&lt;P&gt;plus you need additional 6 "&amp;gt;= A and &amp;lt;=Z" (false) plus 6 times 6 equal comparisons (36) -&amp;gt; Total  64&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would save ~50% of your comparisons in this case (depending on real data distribution).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Volker&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Dec 2010 09:35:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/seeking-performance-for-multiple-calls/m-p/7508405#M1559248</guid>
      <dc:creator>volker_borowski2</dc:creator>
      <dc:date>2010-12-15T09:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking performance for multiple calls</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/seeking-performance-for-multiple-calls/m-p/7508406#M1559249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for ur answer Volker. Not really what i asked for but nevertheless useful since I had not thought about it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Dec 2010 11:30:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/seeking-performance-for-multiple-calls/m-p/7508406#M1559249</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-16T11:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking performance for multiple calls</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/seeking-performance-for-multiple-calls/m-p/7508407#M1559250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;quite hard to give you an answer here ... since you experience peformance "problems" on that level or want to optimize on that level it can be difficult to see significant improvements. On the other side we can congratulate you if you don't have any&lt;/P&gt;&lt;P&gt;other problems on other levels &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; (sql, internal tables, ...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.) Generally speaking you should make sure to pass your data per reference (avoid copy costs). &lt;/P&gt;&lt;P&gt;2.) Generally speaking you should keep the number of calls as small as possible (modularize don't atomize)&lt;/P&gt;&lt;P&gt;3.) Generally speaking local calls (performs, call methods in local classes or instances, function calls to one function group) should be faster than global calls (external performs, call methos in global classes or instances, function calls in other funciton groups) (not sure if this is true any more.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4.) Some years ago i learned the performs are faster than methods or function modules but i'm not sure whether this is true with current releases. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5.) I suppose you have to meassure it yourself if you want to find it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So i would double check 1 and 2... reg. 3 - 5 I'm afraid you you have to do your own test. If you do so, please&lt;/P&gt;&lt;P&gt;share your results with us.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Dec 2010 13:16:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/seeking-performance-for-multiple-calls/m-p/7508407#M1559250</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2010-12-16T13:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking performance for multiple calls</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/seeking-performance-for-multiple-calls/m-p/7508408#M1559251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Not allowed characters in the load string will either:&lt;/P&gt;&lt;P&gt;a. be replaced with _ or&lt;/P&gt;&lt;P&gt;b. deleted or&lt;/P&gt;&lt;P&gt;c. dealt with in some more complex way.&lt;/P&gt;&lt;P&gt;\[..\]&lt;/P&gt;&lt;P&gt;From a performance point of view what is the best and what are the performance pros and cons of each?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I like Volker's answer, because based on the details you've given it's not obvious that the three proposed different call approaches actually make a significant difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe I'm off here and you measured already and noticed that your find&amp;amp;fix logic is lightning fast (compared to the call overhead). If so, ignore my comment, otherwise I'd strongly suggest to code the logic and measure. It should be trivial to try the different approaches and see if varying your call approach actually has a significant impact. I'm suspecting you might end up spending some time on figuring out the best way for the find&amp;amp;fix rather than how to invoke that logic...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On top of the general comments Hermann made, I'm also wondering if there might be some differences in the ABAP VM optimizations based on platform that might impact the results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers, harald&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Dec 2010 07:08:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/seeking-performance-for-multiple-calls/m-p/7508408#M1559251</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-17T07:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking performance for multiple calls</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/seeking-performance-for-multiple-calls/m-p/7508409#M1559252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems like the best idea is to implment alternatives and measure the difference. This begs the question: how to measure the performance?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have no experience in measuring ABAP performance. Hence I would appreicate any suggestions - pls not too scientific/complex - on how to approach this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Dec 2010 07:36:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/seeking-performance-for-multiple-calls/m-p/7508409#M1559252</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-20T07:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Seeking performance for multiple calls</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/seeking-performance-for-multiple-calls/m-p/7508410#M1559253</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use SE30 for that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Volker&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. I missed 12 comparisons in my example...&lt;/P&gt;&lt;P&gt;The 28 comparisons (true) are OK, but the remaining lack the 12 from the (false) section thus bringing the total number to 76&lt;/P&gt;&lt;P&gt;and the ratio to 33% savings, but anyway it was a theoretical examle.&lt;/P&gt;&lt;P&gt;For real it will depend on you average data distribution, and of course you can sort the elimination of the desired&lt;/P&gt;&lt;P&gt;target chars by cardinality in addition, in case those are unevenly distributed as well (exit upon first hit).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Dec 2010 19:28:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/seeking-performance-for-multiple-calls/m-p/7508410#M1559253</guid>
      <dc:creator>volker_borowski2</dc:creator>
      <dc:date>2010-12-20T19:28:41Z</dc:date>
    </item>
  </channel>
</rss>

