Performance of multiple Iterators

Hi,
my question is, which alternative will be faster. I have a class and I'm running several Iterators after each other. However, the elements in the Iterators are of the same type, so there are two possibilities:
//case 1: create a new Iterator and a new MyObject each time =======
Iterator i = something.items();
while (i.hasNext()) {
     MyObject myO = (MyObject) i.next();
     // do something
Iterator i2 = something2.items();
while (i2.hasNext()) {
     MyObject myO = (MyObject) i2.next();
     // do something
Iterator i3 = something3.items();
while (i3.hasNext()) {
     MyObject myO = (MyObject) i3.next();
     // do something
//case 2: create the Iterator and object only one time and reassign it =======
MyObject myO;
Iterator i = something.items();
while (i.hasNext()) {
     myO = (MyObject) i.next();
     // do something
i = something2.items();
while (i2.hasNext()) {
     myO = (MyObject) i.next();
     // do something
i = something3.items();
while (i3.hasNext()) {
     myO = (MyObject) i.next();
     // do something
}I'd assume option 2 is better performing, but I've rarely seen it anywhere in forums or sourcecode...
Thanks for your opinions,
Bj�rn

I'd assume option 2 is better performing, but I've rarely seen it
anywhere in forums or sourcecode...It has nothing to do with performance; the second option just saves
a few bytes on the current stack frame (just one iterator instead of
three to store).
You can circumvent this completely by doing this:for (Iterator i= something.iterator(); i.hasNext(); ) {
   // do something with i.next()
}now you have a new iterator that shares its little part of the stack frame
with the other iterators defined local to their for-loop.
kind regards,
Jos

Similar Messages

  • Hyperion Performance Scorecard Multiple Applications

    How I can create Hyperion Performance Scorecard Multiple Applications in the same instance like Hyperion Planning and Hyperion Financial Management.
    Thank You,
    Bishoy Sami

    Have you checked the documentation ? http://download.oracle.com/docs/cd/E12825_01/nav/portal_1.htm
    HTH
    Srini

  • Sap script - Perform returning multiple line items

    I am making payment advice layout which is called from the transaction f-58. I do not need to change the standard program, since all information is available in the standard layout, but I need to display line items in the new layout I am preparing!
    So to display line items, I have copied the layout and used perform statement and called another se38 prog to retrieve line items.
    The following is written in se71-
    PERFORM FORM_GET_DATA IN PROGRAM ZFR005_PAYMENT_ADVICE
    USING &VV_VBLNR& (this is my header data)
    CHANGING &V_XBLNR1&
    CHANGING &V_BLDAT1&
    CHANGING &V_BELNR1&
    This works fine if I just have to retrieve one line item , but to get multiple , I need to declare multiple changing parameter and print it, because perform is called only once.
    PERFORM FORM_GET_DATA IN PROGRAM ZFR005_PAYMENT_ADVICE
    USING &VV_VBLNR& (this is my header data)
    CHANGING &V_XBLNR1&
    CHANGING &V_BLDAT1&
    CHANGING &V_BELNR1&
    CHANGING &V_XBLNR2&
    CHANGING &V_BLDAT2&
    CHANGING &V_BELNR2&
    .................3
    .................4
    How do I call this perform multiple times so that I do not have to create multiple changing parameters to retrieve line items?

    Hi,
    In the SAPSCRIPT , we can write abap code if the tag column has '/:' command line....
    So, any looping operation can be done to retrieve the data.
    Pass the item no. also (in the 'USING' part), for which the details are required.
    Hope this helps.
    Regards,
    Renjith

  • Slow performance when multiple threads access static variable

    Originally, I was trying to keep track of the number of function calls for a specific function that was called across many threads. I initially implemented this by incrementing a static variable, and noticed some pretty horrible performance. Does anyone have an ideas?
    (I know this code is "incorrect" since increments are not atomic, even with a volatile keyword)
    Essentially, I'm running two threads that try to increment a variable a billion times each. The first time through, they increment a shared static variable. As expected, the result is wrong 1339999601 instead of 2 billion, but the funny thing is it takes about 14 seconds. Now, the second time through, they increment a local variable and add it to the static variable at the end. This runs correctly (assuming the final increment doesn't interleave which is highly unprobable) and runs in about a second.
    Why the performance hit? I'm not even using volatile (just for refernce if I make the variable volatile runtime hits about 30 seconds)
    Again I realize this code is incorrect, this is purely an interesting side-expirement.
    package gui;
    public class SlowExample implements Runnable
         public static void main(String[] args)
              SlowExample se1 = new SlowExample(1, true);
              SlowExample se2 = new SlowExample(2, true);
              Thread t1 = new Thread(se1);
              Thread t2 = new Thread(se2);
              try
                   long time = System.nanoTime();
                   t1.start();
                   t2.start();
                   t1.join();
                   t2.join();
                   time = System.nanoTime() - time;
                   System.out.println(count + " - " + time/1000000000.0);
                   Thread.sleep(100);
              catch (InterruptedException e)
                   e.printStackTrace();
              count = 0;
              se1 = new SlowExample(1, false);
              se2 = new SlowExample(2, false);
              t1 = new Thread(se1);
              t2 = new Thread(se2);
              try
                   long time = System.nanoTime();
                   t1.start();
                   t2.start();
                   t1.join();
                   t2.join();
                   time = System.nanoTime() - time;
                   System.out.println(count + " - " + time/1000000000.0);
              catch (InterruptedException e)
                   e.printStackTrace();
               * Results:
               * 1339999601 - 14.25520115
               * 2000000000 - 1.102497384
         private static int count = 0;
         public int ID;
         boolean loopType;
         public SlowExample(int ID, boolean loopType)
              this.ID = ID;
              this.loopType = loopType;
         public void run()
              if (loopType)
                   //billion times
                   for (int a=0;a<1000000000;a++)
                        count++;
              else
                   int count1 = 0;
                   //billion times
                   for (int a=0;a<1000000000;a++)
                        count1++;
                   count += count1;
    }

    Peter__Lawrey wrote:
    Your computer has different types of memory
    - registers
    - level 1 cache
    - level 2 cache
    - main memory.
    - non CPU local main memory (if you have multiple CPUs with their own memory banks)
    These memory types have different speeds. Depending on how you use a variable affects which memory it is placed in.Plus you have the hotspot compiler kicking in sometime during the run. In other words for some time the VM is interpreting the code and then all of a sudden its compiled and executing the code compiled. Reliable micro benchmarking in java is not easy. See [Robust Java benchmarking, Part 1: Issues|http://www.ibm.com/developerworks/java/library/j-benchmark1.html]

  • Query performance when multiple single variable values selected

    Hi Gurus,
    I have a sales analysis report that I run with some complex selection criteria.  One of the variables is the Sales Orgranisation.
    If I run the report for individual sales organisations, the performance is excellant, results are dislayed in a matter of seconds.  However, if I specify more than one sales organisation, the query will run and run and run.... until it eventually times out.
    For example; 
    I run the report for SALEORG1 and the results are displayed in less than 1 minute. 
    I then run the report for SALEORG2 and again the results are displayed in less than 1 minute.
    If I try to run the query for both SALEORG1 and SALEORG2, the report does not display any results but continues until it times out.
    Anybody got any ideas on why this would be happening?
    Any advise, gratefully accepted.
    Regards,
    David

    While compression is generally something that you should be doing, I don't think it is a factor here, since query performance is OK when using just a sinlge value.
    I would do two things - first make sure the DB stats for the cube are current.  You might even consider increasing the sample rate for the stats collection  if you are using one.  You don't mention the DB you use, or what type of index is on Salesorg which could play a role. Does the query run against a multiprovider on top of multiple cubes, or is there just one cube involved.
    If you still have problems after refreshing the stats, then I think the next step is to get a DB execution plan for the query by running the query from RSRT debugging mode when it is run with just one value and another when run with multiple values to see if the DB is doing something different - seek out your DBA if you are not familiar with executoin plan.

  • Performance for multiple tablespaces

    Hi,
    I have 8 oracle instances with an only user for every instance.
    My customer asked me to create an only instance with 8 tablespaces and 8 different users.
    These instances could also further increase.
    I think that avoiding creating all these tablespaces on an only instance, because I think that it would be possible to have a reduction of the performances.
    According to you what problem would it be possible to verify afterwards doing an operation of the kind?
    What are the advantages and disadvantages of putting multiple schemas on one database instead of on seperate databases? (SGA, I/O, MEMORY..........)
    Thanks
    Raf

    Look at it this way, with your avail memory split between 8 instances, each of these sgas is of no use to the other 7 instances when that user is idle. If you used all the available memory for one instance, then all the memory will be available when required.
    Provided you create the tablespaces for a single instance the way the individual instances are layed out then i/o will not change (an i/o wait is an i/o wait no matter who generates it). In fact, you will have more storage space available as you will have only one each of system, rollback and temp tablespaces instead of 8.
    I hope this helps.

  • Squiggly performance on multiple containers

    Hi,
    I am using Squiggly for TLF on a text flow that can have variable number of containers. Once the number of containers in a text flow starts to go up (say, past 10), the interaction performance (such as typing) while Squiggly is turned on starts to drop rather quickly, and soon becomes rather unusable. The implementation is rather simple, in that it's a multi-page document, with each page having between 1 and 2 containers, and only one page is displayed at a time. With this kind of implementation, only 1 or 2 out of, say, 20 containers are displayed at a time, so it really isn't necessary to have Squiggly checking the entire text flow. It seems having Squiggly enabled/disabled on a container basis would make more sense, from performance perspective.
    Are there any thoughts about enabling and disabling Squiggly on a container basis? Or is there a workaround for the performance issue with multiple containers?
    Thank you for the info.
    Will

    Hi Utsav,
    Thank you for your reply. Correct, all the containers on the pages share the same text flow, and text is flowed like threaded text frames in, say, InDesign. At any given point, only a couple containers at the most are displayed. We do try to break the content into multiple, smaller text flows, but sometimes longer ones are not avoidable.
    I can try to come up with a Flex project illustrating this if you like. I'd probably just do something like adding 20 containers to a text flow, but only add the first and last containers to the stage, fill the text flow with text, enable Squiggly, and start typing.
    Will

  • List with multiple Iterators - result predictible?

    Hi,
    I have a situation where a list is used by two Iterators:
    List a;
    Iterator i1 = a.iterator();
    while (i1.hasNext()) {
    Object o1 = i1.next();
    Iterator i2 = a.iterator();
    while (i2.hasNext()) {
    Object o2 = i2.next();
    // do something to "o2" - modify or remove through i2.remove()
    I have seen other discussions, but my impression is it's mostly "Hash" or "Tree" that has a un-predictible result, or even clearer - fast-failing. For a List, it seems to me what would happen is quite certain (e.g. if the inner iterator removes an object, that object would be gone from the collection, but the outer iterator would still hold a reference to it, thus still be able to access it). However, in Java API, Iterator.remove() method has notes saying it's "unspecified" for all modifications unless using that particular method correctly.
    I think this is designed on purpose, but don't know why. Any thoughts?
    Thanks,

    An Iterator.delete() has the spec:
    public void remove()
    Removes from the underlying collection the last element returned by the iterator (optional operation). This method can be called only once per call to next. The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.
    So when in your example the second iterator modifies the underlying collection it breaks the first instance iterator behavior which has then an unpredictable result.
    Using a List.iterator() seems to change nothing :
    public Iterator iterator()
    Returns an iterator over the elements in this list in proper sequence.
    Specified by:
    iterator in interface Collection
    Returns:
    an iterator over the elements in this list in proper sequence.
    So you code isn't garanty to run as you quote it running. The i2 is safe not i1 if you use i2.remove().
    I did this test:
         List v1 = new Vector();
         v1.add("1");
         v1.add("2");
         v1.add("3");
         Iterator i1 = v1.iterator();
         while (i1.hasNext()) {
              Object o1 = i1.next(); // At second iteration I got a ConcurrentModificationException here.
              Iterator i2 = v1.iterator();
              while (i2.hasNext()) {
                   i2.next();
                   i2.remove();
              System.out.println(o1);
    That's a typical unexpected results because hasNext() answered true but next() failed.
    Now if your question is why this spec, I dunno, I could only guess that the purpose of Iterator generic interface is to allow to have efficient implementation at price of non concurent modification access.

  • Java Sockets on Linux OS - Poor performances with multiple sockets

    Hi,
    My app is making use of RMI processes in order to distribute maths calculations over a number of nodes. The point is that when I'm making use of only 1 RMI process, computation time on the node (nearly) matches teh total time seen by the client app, when I make use of 2 RMI processes concurrently, there is some time wasted misteriously somewhere (I guess network/TCP).
    I googled a bit and apparently re-transmission might be a possible cause for this... tried to change TcpNoDelay attribute on the Socket objects for creating RMI endpoints, but performances stayed exactly the same.
    Any idea/suggestions?
    If the prob is not clear enough please feel free to make questions.
    Thanks,
    Giovanni
    EDIT
    How can I be 100% sure that the TcpNoDelay was correctly used? Shall I specify it somehow also in the ServerSocket? Or in teh Socket obj is enough??
    Edited by: nemo83 on Oct 4, 2011 1:33 AM

    How is this different from your RMI Network Performances degradation?
    Locking.

  • Performance with multiple out refcursors

    Hello,
    I've created a sp with 10 output refcursors, it is actually to fetch Programinfo from the database.
    earlier i had used 4-5 seperate sp's and called them from C# code, and it was taking abt 70-100 millisec to fetch one program.
    Now i wanted to improve the performance, and i tried to create a simgle sp which has 10 output refcursors, now this is taking abt 110-1125 ms to fetch one program.
    i'm pasting below the new sp i've writtten, please let me know how I can imprrve the performance, please help me, thanks - shruti
    PROCEDURE "CPADMIN"."CPX_SP_FETCH_PROGRAMINFO_N" (
    "I_PROGRAMID" IN NUMBER,
    "I_VERSION" IN NUMBER,
    "O_REFCUR" OUT SYS_REFCURSOR,
    "O_REFCUR1" OUT SYS_REFCURSOR,
    "O_REFCUR2" OUT SYS_REFCURSOR,
    "O_REFCUR3" OUT SYS_REFCURSOR,
    "O_REFCUR4" OUT SYS_REFCURSOR,
    "O_REFCUR5" OUT SYS_REFCURSOR,
    "O_REFCUR6" OUT SYS_REFCURSOR,
    "O_REFCUR7" OUT SYS_REFCURSOR,
    "O_REFCUR8" OUT SYS_REFCURSOR,
    "O_REFCUR9" OUT SYS_REFCURSOR
    ) IS
    -- SP Name : CPX_SP_FETCH_PROGRAMINFO
    -- Description : Fetches program Info by ProgramID
    -- Input Param : I_PROGRAMID - EventID
    --                    I_VERSION - Program Version
    -- Output Param : O_REFCUR - refcursor
    -- Output Param : O_REFCUR1 - refcursor for final languages
    -- Output Param : O_REFCUR2 - refcursor for genre
    -- Output Param : O_REFCUR3 - refcursor for category
    -- Output Param : O_REFCUR4 - refcursor for numeric fields
    -- Output Param : O_REFCUR5 - refcursor for date fields
    -- Output Param : O_REFCUR6 - refcursor for credit language id
    -- Output Param : O_REFCUR7 - refcursor for credits data
    -- Output Param : O_REFCUR8 - refcursor for credits data
    -- Output Param : O_REFCUR9 - refcursor for credits data
    -- Tables : CPX_Program, CPX_PROGRAM_VERSION
    -- Created By : Shruti Lalwani - 24Jan2008
    -- Change History : shruti lalwani - 26 Mar 2008
    -- removed the LanguageId input param
    intCnt number;
    intIsFinal number;
    intPVersion number;
    intLVersion number;
    strLanguage varchar2(100);
    intSchCnt number;
    BEGIN -- executable part starts here
    if I_VERSION > 0 then
         -- get the particular version from cpx_program_version
         select count(*) into intCnt
         from CPX_PROGRAM Prg
         inner join CPX_PROGRAM_VERSION PrgV on Prg.ID=PrgV.Program_ID
         and Prg.ID = I_PROGRAMID
         and PrgV.VErsion = I_VERSION;
         if intCnt > 0 then
              open o_refcur for
              select Prg.ID as ProgramID, Prg.Type_ID as PrgType,
              PrgV.VErsion as ProgramVersion, Prg.Schedule_Only, Prg.Origin, Prg.Status_ID as StatusId,
              nvl(Prg.IN_USE_BY,0) as IN_USE_BY_ID,
              nvl((select Usr.Display_Name from CPX_User Usr where ID= Prg.IN_USE_BY),' ') as IN_USE_BY_NAME,
              nvl(in_use_since,TO_DATE('1-Jan-1970','DD-MON-YY HH:MI:SS AM')) as In_Use_since, Prg.Latest_Version as Latest_Version
              --in_use_since as In_Use_since, Prg.Latest_Version as Latest_Version
              from CPX_PROGRAM Prg
              inner join CPX_PROGRAM_VERSION PrgV on Prg.ID=PrgV.Program_ID
              and Prg.ID = I_PROGRAMID
              and PrgV.VErsion = I_VERSION;
              open o_refcur1 for
              select DISTINCT PrgContT.Language_ID as LanguageID
              from CPX_PROGRAM Prg
              inner join CPX_PROGRAM_CONTENT_TEXT PrgContT on Prg.ID = PrgContT.Program_ID
              and PrgContT.Program_version = (case when I_VERSION > 0 then I_VERSION else Prg.Latest_version end)
              and Prg.ID = I_PROGRAMID
              and PrgContT.Language_id >= 0;
              open o_refcur2 for
              select PrgText.Field_Id as FieldID, PrgText.Content as Content, PrgText.Variant_Id as VariantId,PrgText.Language_ID as Language_ID
              from CPX_Program_Content_Text PrgText
              inner join CPX_PROGRAM_VERSION PrgV on PrgV.Program_Id = PrgText.Program_Id
              inner join CPX_PROGRAM Prg on Prg.Id= PrgV.Program_Id
              inner join CPX_Language lang on PrgText.Language_Id= lang.ID
              and PrgV.Version = PrgText.Program_version
              and Prg.Id= I_PROGRAMID and PrgV.Version = I_VERSION
              order by PrgText.Language_ID, FieldId asc;
              select schedule_only into intSchCnt
              from CPX_PROGRAM Prg
              inner join CPX_PROGRAM_VERSION PrgV on Prg.ID=PrgV.Program_ID
              and Prg.ID = I_PROGRAMID
              and PrgV.VErsion = I_VERSION;
              -- fetch only for real program
              if intSchCnt = 0 then
                   open o_refcur3 for
                   select language_id, version
                   from CPx_PROGRAM_LANGUAGE_STATUS
                   where program_id = I_PROGRAMID and version > 0;
                   open o_refcur4 for
                   select      PrgG.Genre_Id as GenreID
                   from CPX_PROGRAM Prg
                   inner join CPX_PROGRAM_VERSION PrgV on Prg.ID=PrgV.Program_ID
                   inner join CPX_PROGRAM_GENRE PrgG on PrgG.Program_id = Prg.ID
                   and Prg.ID = I_PROGRAMID
                   and PrgV.VErsion = I_VERSION
                   and PrgG.Program_version = PrgV.VErsion;
                   open o_refcur5 for
                   select PrgCat.Category_Id as CategoryID
                   from CPX_PROGRAM Prg
                   inner join CPX_PROGRAM_CATEGORY PrgCat on Prg.ID = PrgCat.Program_ID
                   and PrgCat.Program_version = (case when I_VERSION > 0 then I_VERSION else Prg.Latest_version end)
                   and Prg.ID = I_PROGRAMID;
                   open O_RefCur6 for
                   select PrgNum.Field_Id as FieldID, PrgNum.Content as Content, PrgNum.Variant_Id as VariantId
                   from CPX_Program_Content_Number PrgNum
                   inner join CPX_PROGRAM_VERSION PrgV on PrgV.Program_Id = PrgNum.Program_Id
                   inner join CPX_PROGRAM Prg on Prg.Id= PrgV.Program_Id
                   and PrgV.Version = PrgNum.Program_version
                   and Prg.Id= I_PROGRAMID and PrgV.Version = I_VERSION
                   order by FieldId asc;
                   open O_RefCur7 for
                   select PrgDate.Field_Id as FieldID, PrgDate.Content as Content
                   from CPX_Program_Content_Date PrgDate
                   inner join CPX_PROGRAM_VERSION PrgV on PrgV.Program_Id = PrgDate.Program_Id
                   inner join CPX_PROGRAM Prg on Prg.Id= PrgV.Program_Id
                   and PrgV.Version = PrgDate.Program_version
                   and Prg.Id= I_PROGRAMID and PrgV.Version = I_VERSION
                   order by FieldId asc;
                   open o_refcur8 for
                   select DISTINCT PrgCredit.Language_ID as LanguageID
                   from CPX_PROGRAM PRg
                   inner join CPX_PROGRAM_CREDIT PrgCredit on Prg.ID = PrgCredit.Program_ID
                   and PrgCredit.Program_version = (case when I_VERSION > 0 then I_VERSION else Prg.Latest_version end)
                   and Prg.ID = I_PROGRAMID
                   and PrgCredit.Language_id >= 0;
                   open O_RefCur9 for
                   select PrgCr.Role_Id as RoleID, PrgCr.Person_Id as PersonID, PrgCr.character as Character,
                   PrgCr.Sequencenr as Sequencenr, Person.first_name as First_Name , Person.Last_Name as Last_Name,Language_ID
                   from CPX_Program_Credit PrgCr
                   inner join CPX_PROGRAM_VERSION PrgV on PrgV.Program_Id = PrgCr.Program_Id
                   inner join CPX_PROGRAM Prg on Prg.Id= PrgV.Program_Id
                   inner join CPX_Person Person on PrgCr.Person_ID = Person.ID
                   and PrgV.Version = PrgCr.Program_version
                   and Prg.Id= I_PROGRAMID and PrgV.Version = I_VERSION
                   order by PrgCr.Language_ID,PrgCr.Sequencenr asc;
              end if;
         end if;
    else
         -- get the latest version from cpx_program
         if I_VERSION = -1 then
              select count(*) into intCnt
              from CPX_PROGRAM Prg
              inner join CPX_PROGRAM_VERSION PrgV on Prg.ID=PrgV.Program_ID
              and Prg.Latest_Version = PrgV.Version
              and Prg.ID = I_PROGRAMID;
              if intCnt > 0 then
                   open o_refcur for
                   select Prg.ID as ProgramID, Prg.Type_ID as PrgType,
                   Prg.Latest_VErsion as ProgramVersion, Prg.Schedule_Only, Prg.Origin, Prg.Status_ID as StatusId,
                   nvl(Prg.IN_USE_BY,0) as IN_USE_BY_ID,
                   nvl((select Usr.Display_Name from CPX_User Usr where ID= Prg.IN_USE_BY),' ') as IN_USE_BY_NAME,
                   nvl(in_use_since,TO_DATE('1-Jan-1970','DD-MON-YY HH:MI:SS AM')) as In_Use_since, Prg.Latest_Version as Latest_Version
              --in_use_since as In_Use_since, Prg.Latest_Version as Latest_Version               
              from CPX_PROGRAM Prg
                   inner join CPX_PROGRAM_VERSION PrgV on Prg.ID=PrgV.Program_ID
                   and Prg.Latest_Version = PrgV.VErsion
                   and Prg.ID = I_PROGRAMID;
                   open o_refcur1 for
                   select DISTINCT PrgContT.Language_ID as LanguageID
                   from CPX_PROGRAM Prg
                   inner join CPX_PROGRAM_CONTENT_TEXT PrgContT on Prg.ID = PrgContT.Program_ID
                   and PrgContT.Program_version = (case when I_VERSION > 0 then I_VERSION else Prg.Latest_version end)
                   and Prg.ID = I_PROGRAMID
                   and PrgContT.Language_id >= 0;
                   open o_refcur2 for
                   select PrgText.Field_Id as FieldID, PrgText.Content as Content, PrgText.Variant_Id as VariantId,PrgText.Language_ID as Language_ID
                   from CPX_Program_Content_Text PrgText
                   inner join CPX_PROGRAM_VERSION PrgV on PrgV.Program_Id = PrgText.Program_Id
                   inner join CPX_PROGRAM Prg on Prg.Id= PrgV.Program_Id
                   inner join CPX_Language lang on PrgText.Language_Id= lang.ID
                   and Prg.Latest_Version = PrgV.Version
                   and PrgV.Version = PrgText.Program_version
                   and Prg.Id= I_PROGRAMID
                   order by PrgText.Language_ID, FieldId asc;
                   select schedule_only into intSchCnt
                   from CPX_PROGRAM Prg
                   inner join CPX_PROGRAM_VERSION PrgV on Prg.ID=PrgV.Program_ID
                   and Prg.Latest_Version = PrgV.VErsion
                   and Prg.ID = I_PROGRAMID;
                   -- fetch only for real program
                   if intSchCnt = 0 then
                        open o_refcur3 for
                        select language_id, version
                        from CPx_PROGRAM_LANGUAGE_STATUS
                        where program_id = I_PROGRAMID and version > 0;
                        open o_refcur4 for
                        select      PrgG.Genre_Id as GenreID
                        from CPX_PROGRAM Prg
                        inner join CPX_PROGRAM_VERSION PrgV on Prg.ID=PrgV.Program_ID
                        inner join CPX_PROGRAM_GENRE PrgG on PrgG.Program_id = Prg.ID
                        and Prg.Latest_Version = PrgV.Version
                        and PrgG.Program_version = PrgV.VErsion
                        and Prg.ID = I_PROGRAMID;
                        open o_refcur5 for
                        select PrgCat.Category_Id as CategoryID
                        from CPX_PROGRAM Prg
                        inner join CPX_PROGRAM_CATEGORY PrgCat on Prg.ID = PrgCat.Program_ID
                        and PrgCat.Program_version = (case when I_VERSION > 0 then I_VERSION else Prg.Latest_version end)
                        and Prg.ID = I_PROGRAMID;
                        open O_RefCur6 for
                        select PrgNum.Field_Id as FieldID, PrgNum.Content as Content, PrgNum.Variant_Id as VariantId
                        from CPX_Program_Content_Number PrgNum
                        inner join CPX_PROGRAM_VERSION PrgV on PrgV.Program_Id = PrgNum.Program_Id
                        inner join CPX_PROGRAM Prg on Prg.Id= PrgV.Program_Id
                        and Prg.Latest_Version = PrgV.Version
                        and PrgV.Version = PrgNum.Program_version
                        and Prg.Id= I_PROGRAMID
                        order by FieldId asc;
                        open O_RefCur7 for
                        select PrgDate.Field_Id as FieldID, PrgDate.Content as Content
                        from CPX_Program_Content_Date PrgDate
                        inner join CPX_PROGRAM_VERSION PrgV on PrgV.Program_Id = PrgDate.Program_Id
                        inner join CPX_PROGRAM Prg on Prg.Id= PrgV.Program_Id
                        and Prg.Latest_Version = PrgV.Version
                        and PrgV.Version = PrgDate.Program_version
                        and Prg.Id= I_PROGRAMID
                        order by FieldId asc;
                        open o_refcur8 for
                        select DISTINCT PrgCredit.Language_ID as LanguageID
                        from CPX_PROGRAM PRg
                        inner join CPX_PROGRAM_CREDIT PrgCredit on Prg.ID = PrgCredit.Program_ID
                        and PrgCredit.Program_version = (case when I_VERSION > 0 then I_VERSION else Prg.Latest_version end)
                        and Prg.ID = I_PROGRAMID
                        and PrgCredit.Language_id >= 0;
                        open O_RefCur9 for
                        select PrgCr.Role_Id as RoleID, PrgCr.Person_Id as PersonID, PrgCr.character as Character,
                        PrgCr.Sequencenr as Sequencenr,Person.first_name as First_Name , Person.Last_Name as Last_Name, Language_ID
                        from CPX_Program_Credit PrgCr
                        inner join CPX_PROGRAM_VERSION PrgV on PrgV.Program_Id = PrgCr.Program_Id
                        inner join CPX_PROGRAM Prg on Prg.Id= PrgV.Program_Id
                        inner join CPX_Person Person on PrgCr.Person_ID = Person.ID
                        and Prg.Latest_Version = PrgV.Version
                        and PrgV.Version = PrgCr.Program_version
                        and Prg.Id= I_PROGRAMID
                        order by PrgCr.Language_ID,PrgCr.Sequencenr asc;
              end if;
              end if;
         end if;
    end if;
    END "CPX_SP_FETCH_PROGRAMINFO_N";

    This is remarkably ugly from the standpoint of fetching all of this information using separate REF CURSORS because you seem to be hitting the same tables, for example "CPX_PROGRAM," again and again and again. Why not hit the tables once, load an interim result set into an array and then use that subset of your table data to then extract what you need?

  • Has The Performance Of Multiple AI Inputs Anything To Do With Computer Speed/RAM Size? (Using Windows XP)

    Hello,
    I am using LabView-DAGmx and PXI-6220 to acquire voltage (differential) data. The application needs 8 channels which PXI-6220 should be able to support easily, but also must have 10  1-D Floating Point Arrays (8 elements in each) in order to keep on calculating the average, verifying the readings, allowing changing the set points, ... etc. I also use 8 elapsed counter VIs to display the times in the application. While I really didn't think the FP Arrays and the calculation are a lot to my workstation, I found from time to time the elapsed counters are not constantly updating the times (strings) and the CPU Usage has hit 80%. I then modified my VI to do only 4 channels instead of 8 channels, and the CPU Usage would remain below 40% (I think it's still very high.) At the point, the timers were still not able to update the time display fast enough, although I found every time a correct time will be displayed when it updates.
    My question is, how much memory should be appropriate for this kind of application (LabView & My Multiple Channel Averaging)? I have now Pentium 4 3GHz and 1GB RAM. Is upgrading RAM to 2G or 4G going to help a lot in the situation? If we intend to use TestStand, what size of RAM would an expert recommand?
    Thanks!

    I see several things in your code that can be improved: 
     The calculations in the for loop should be done with auto indexing of the for-loop
    The memory you use inside the for loop could be stored with shift register, no need for the property nodes which influences your speed in a very bad way
    The calculations you do in the bottom part are all referenced via VI-server, this can be influencing your speed as well
    Ton
    PS you can attach pictures directly.
    To attach pictures of your code I advice the Code Capture Tool. It is great for this purpose, you select the part you want to capture, start the tool (Tools->Code Capture Tool), review your setting (FP-none, BD-selected, Clipboard-FileName), finish the capture.
    Then you switch over to your internet browser, in the file dialog you past the file name from the clipboard and the file is attached.
    To download
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Live Performances, with multiple harware????

    I just bought a powerbook, and live 5..
    I'm about to start playing out with my original tracks.
    I was a dj fro 7 years and recently am making the change to live computer performance.
    The problem I'm having in I have an externalk firewire drive with my tunes, a usb midi controller, a mouse, a firewire interface etc etc.
    the powerbook only has one usb slot and one firewire slot.
    How can this happen?
    I've bought a usb hub (dosen't work?"
    the guys ant apple tell me I cant but a firewire hub...
    whats the deal
    how do you guys do it???

    really? I had picked up one of those belkin stackable usb hubs, and nothing worked through it, even my xkeys didn't read???
    I've been told that hubs will not work for usb controllers like say the oxygen 8 and so far they have been right? Maybe its my hub? It cost 70 dollars???
    What hub do you use? Do you dj live with a powerbook and controllers etc..
    How do you daisy chain firewire devices? heres what I'm trying to accomplish:
    17" Powerbook 1.67 ghz with 2gb of ram
    M-Audio 410 firewire interface
    for now THE EVOLUTION UC-33E CONTROLLER
    M-AUDIO OXYGEN 8 CONTROLLER (I'M UPGRADING TO A KORG CONTROL LIKE TODAY)
    A FIREWIRE LACIE HD
    A MOUSE IF POSSIBLE
    LIVE 5
    REASON 3.0
    How do I go about hooking this up fopr a live show????

  • How to tune performance of a cube with multiple date dimension?

    Hi, 
    I have a cube where I have a measure. Now for a turn time report I am taking the date difference of two dates and taking the average, max and min of the date difference. The graph is taking long time to load. I am using Telerik report controls. 
    Is there any way to tune up the cube performance with multiple date dimension to it? What are the key rules and beset practices for a cube to perform well? 
    Thanks, 
    Amit

    Hi amit2015,
    According to your description, you want to improve the performance of a SSAS cube with multiple date dimension. Right?
    In Analysis Services, there are many tips to improve the performance of a cube. In this scenario, I suggest you only keep one dimension, and only include the column which are required for your calculation. Please refer to "dimension design" in
    the link below:
    http://www.mssqltips.com/sqlservertip/2567/ssas--best-practices-and-performance-optimization--part-3-of-4/
    If you have any question, please feel free to ask.
    Simon Hou
    TechNet Community Support

  • Performance with the new Mac Pros?

    I sold my old Mac Pro (first generation) a few months ago in anticipation of the new line-up. In the meantime, I purchased a i7 iMac and 12GB of RAM. This machine is faster than my old Mac for most Aperture operations (except disk-intensive stuff that I only do occasionally).
    I am ready to purchase a "real" Mac, but I'm hesitating because the improvements just don't seem that great. I have two questions:
    1. Has anyone evaluated qualitative performance with the new ATI 5870 or 5770? Long ago, Aperture seemed pretty much GPU-constrained. I'm confused about whether that's the case anymore.
    2. Has anyone evaluated any of the new Mac Pro chips for general day-to-day use? I'm interested in processing through my images as quickly as possible, so the actual latency to demosaic and render from the raw originals (Canon 1-series) is the most important metric. The second thing is having reasonable performance for multiple brushed-in effect bricks.
    I'm mostly curious if anyone has any experience to point to whether it's worth it -- disregarding the other advantages like expandability and nicer (matte) displays.
    Thanks.
    Ben

    Thanks for writing. Please don't mind if I pick apart your statements.
    "For an extra $200 the 5870 is a no brainer." I agree on a pure cost basis that it's not a hard decision. But I have a very quiet environment, and I understand this card can make a lot of noise. To pay money, end up with a louder machine, and on top of that realize no significant benefit would be a minor disaster.
    So, the more interesting question is: has anyone actually used the 5870 and can compare it to previous cards? A 16-bit 60 megapixel image won't require even .5GB of VRAM if fully tiled into it, for example, so I have no ability, a priori, to prove to myself that it will matter. I guess I'm really hoping for real-world data. Perhaps you speak from this experience, Matthew? (I can't tell.)
    Background work and exporting are helpful, but not as critical for my primary daily use. I know the CPU is also used for demosaicing or at least some subset of the render pipeline, because I have two computers that demonstrate vastly different render-from-raw response times with the same graphics card. Indeed, it is this lag that would be the most valuable of all for me to reduce. I want to be able to flip through a large shoot and see each image at 100% as instantaneously as possible. On my 2.8 i7 that process takes about 1 second on average (when Aperture doesn't get confused and mysteriously stop rendering 100% images).
    Ben

  • Alternative Performance Visualizations in SAP Strategy Management

    A question frequently posed to the SAP Strategy Management solution management team is u201Cu2026beyond scorecards and strategy maps, are there other ways within SSM that I can visualize my organizationu2019s performance?u201D The answer is yes.
    The SSM Strategy page allows you to create and display up to three goal diagrams. Typically SSM users will just create a strategy diagram (the most common type of goal diagram) and let the other two goal diagram place holders go unused. However, with a little ingenuity the other two goal diagrams could be put to very good use.
    Using the goal diagram manager on the SSM Administration console you can import custom images (e.g. Adobe Illustrator or MS Visio images) into the SSM Strategy page. Once a custom image has been imported, hotspots can be mapped on top of the image that allow you to view the status and details of scorecard objects in relation to the image. Hotspots can be created for Contexts, Perspectives, Objectives, and KPIs (KPI hotspots are new in SSM 7.0). For each hotspot location a status indicator is displayed reflecting the Red/Yellow/Green status of the scorecard object. When the hotspot is clicked, details for the scorecard object are displayed in a dropdown box.
    So if, for example, you have created contexts for different geographic regions within the United States, you could import a map of the United States and then map context hotspots that allow you to easily view your organizationu2019s performance across geographic regions. So, on your US Map goal diagram you might see a green status icon over California, red over Boston, Yellow over Florida, etc. indicating your organizationu2019s performance in those regions.
    Other custom goal diagram examples include:
    - Organization charts that show the performance of different divisions / groups within your organization
    - Process flow diagrams that show performance of different elements of a business or production process
    - Initiative / project summaries that show the performance of multiple initiatives
    For more information on how to manage custom diagrams in SSM, view the Help topic u201CGoal Diagramsu201D within the SSM Administration console.
    Best Regards,
    Chris Clay
    Enterprise Performance Management
    Solution Management

    Hi Guna,
    Please see this document for recommended roles for strategy management - http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0ac7368-092f-2a10-d68f-8ba5c3f75f10?quicklink=index&overridelayout=true
    Regards,
    Sen

Maybe you are looking for