Can't explain this performance drop

Hi everybody,
i am currently working on a data-mining application which uses a hudge amount of system resources, so tha'ts why i want to parallize it.
I've got a dual xeon server with 8 cores, which i want to use.
The good news: My application can use all 8 cores to execute his task in a very fast manner.
The bad news: If a use another dataSet for my analysis it only uses once core. So that's why I write here to hopefully get some help of more experiences coders.
Situation:
1) How do i parallize:
I got a Vector including sequences which i want to analyze. Therefore I iteratare through this vector and for each sequence i assign a new task in my threadpool (like: [http://www.informit.com/articles/article.aspx?p=30483&seqNum=6] ). This threadpool was initially created with 8 threads (4 or 6 have the same result). The results of each task are stored in a collection (synchronized ArrayList).
2) What kind of work has to be done.
Actually a sequence contains elements which contains items. A worker now checks whether two sequences contain the same items.
At the beginning i give the worker the following arguments:
(SequenceToCompare, ListOfSequencesToCompareWith*, SynchronizedListToPutNewSequenceIn)
*same like the list i iterate through while creating these tasks.
So the worker takes the SequenceToCompare (s1) and iterates through the ListOfSequencesToCompareWith(sList) and checks if they contain the same items.
If they do, it takes s1 and adds the last item of the current sequence of sList. After it puts s1 into the SynchronizedListToPutNewSequenceIn which is filled by all the other threads, too.
3) Different DataSets
The "fast running" dataset is much shorter as the slow one. it has less sequences to compare at the beginnig (1000 against 2000+ (up to 500.000)). Structure is the same. All sequences in the fast dataSet are build out of 15 items, while the slow one contains 75 different items. For each check of the two sequences it iterates through all items in the dataset takes the hashCode compares. Then in the case they are same and I can add an item to s1, i take the hashCode and get the item of a CACHE Objekt, which contains the item in a hashMap. (Can this be my bottleneck?)
4) Problem? Solving?
I hope that my explanation was good enough, maybe we can through this in an iterative way, so please tell me which additional information you need and i will post it (+code).
Your support is highly appreciated.
Regards
Andy

1) How do I parallelize:
Use the Java concurrency libraries
e.g.
Executor executor = Executors.newFixedThreadPool(8);
for(final Object toProcess: myVector)
   executor.submit(new Runnable() {
       public void run() {
           // process toProcess;
    }

Similar Messages

  • Can anyone explain this to me, please. It's a static section question.

    Can anyone explain this to me, please. It's a static section question.
    I came across the following style of programming recently and I would like to know what the Static section is actually doing in the class. Thx.
    Here is the code.
    public class ClassA {
         private static Hashtable ClassAList = new Hashtable();
         private ClassB cB;
         private Vector goodLink;
         private Hashtable classCList;
         static
              ClassA cA = new ClassA();
              ClassAList.put("whatever", cA);
         public static ClassA getClassA()
              return (ClassA) ClassAList.get("whatever");

    hi,
    The static section shall be loaded before it's constructor is called. (i.e at the time of loading the class). Therefore making it available for any other objects to call.
    hope this clarifies ur question
    prasanna

  • Can soemone explain this code to me

    can someone explain this code to me
    import javax.swing.*;
    import BreezySwing.*;
    import java.util.Random;
    public class PennyPinch extends GBFrame
         private JButton enterButton;
         private JTextArea outputArea;
         private int[][] board = {{1,1,1,1,1},{1,2,2,2,1},{1,2,3,2,1},{1,2,2,2,1},{1,1,1,1,1}};
         private boolean[][] landing = new boolean[5][5];
         private int total;
         public PennyPinch()
         enterButton = addButton ("Pitch",2,1,1,1);
         outputArea = addTextArea("",4,1,3,4);
         public void pitch()
              Random generator = new Random();          
              int randomRow = generator.nextInt(5);
              int randomColumn = generator.nextInt(5);
              total += board[randomRow][randomColumn];
              landing[randomRow][randomColumn] = true;
         public void buttonClicked (JButton buttonObj)
              pitch();
              displayList(board, outputArea);
         private void displayList(int a[][], JTextArea output)
    output.setText("");
              for (int row = 0; row < 5; row++)
    for (int col = 0; col < 5; col++){
    if(landing[row][col] ==true)
                                  output.append(Format.justify('r',"P", 3) + " ");
                                  if (col == 4)
    output.append("\n");
                             else
                             output.append(Format.justify('r', a[row][col], 3) + " ");
                             if (col == 4)
    output.append("\n");                    }
              output.append("the total is " + total);
         public static void main (String[] args)
    PennyPinch theGUI = new PennyPinch();
    theGUI.setSize (300, 300);
    theGUI.setVisible(true);
    }

    Knowing toilets or studying under George?What kind pervert are you?
    What is written in public toilets o/c!Ah yes I see, I found example questions.
    2:3.4 please complete the following well known saying
    by filling in the blank
    Whilst you are reading what I put
    You are blank on your foot
    2:3.5 Upon seeing the announcement 'Toilet
    tennis' and following the instruction ' please
    see other wall for details' what is the standard
    message on the other wall.2:3.4. is the correct answer 'micturating' ?
    2:3.5. I believe the answer is Ibidem.

  • Can anyone explain this: Numeric or Value Error Line 1

    I have a stored procedure that starts out like so:
    PROCEDURE test_proc(param1 IN VARCHAR2, param2 IN VARCHAR2, param3 OUT
    SYS_REFCURSOR) IS
    v_var varchar2(5);
    BEGIN
    SELECT * FROM. . .
    The procedure tested fine in PL/SQL Developer. When calling from
    ODP.NET like so. . .
    OracleCommand cmd = new OracleCommand("test_proc", <connection>);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.Add("param1", "somevalue");
    cmd.Parameters.Add("param2", "XX");
    cmd.Parameters.Add("param3", OracleDbType.RefCursor,
    ParameterDirection.Output);
    DataSet ds = new DataSet();
    OracleDataAdapter da = new OracleDataAdapter(cmd);
    con.Open();
    da.fill(ds);
    con.Close();
    . . .the procedure executed as expected. If I changed the value of
    param2 to "XXX" or any value three chars long I got the "ORA-06502:
    Numeric or Value Error at Line 1" error.
    After beating my head against the wall for hours, I tried changing the
    size of v_var to 50, and the error disappeared. Mind you, the error
    was being thrown long before v_var was being set further down in the
    proc. Even more interesting is that the possible values of v_var were
    all less than 5 chars wide. Most interesting: the value of p_param2 had nothing whatever to do with v_var.
    Can anyone explain this?

    Hi,
    Is your database 9206 by chance? Re: Error ORA-06502 PL/SQL
    Cheers,
    Greg

  • Can anyone explain this query.?

    Can anyone explain this query.?
    select nvl(s.p_id,q.p_id),nvl(s.p_type,q.p_type),nvl(s.p_line,q.p_line),
    nvl(s.sales2004,0),nvl(s.sales2005,0),nvl(q.quota2004,0),nvl(q.quota2005,0)
    from sales s
    full outer join quota q on(s.p_id = q.p_id and s.p_type=q.p_type and s.p_line=q.p_line)

    from sales s full outer join quota qTable quota is outer joined to table sales , if there are no matching records in table quota then also the query retuns the sales record with null values for the corresponding quota record columns
    NVL() has been used to handle such cases

  • HT3275 Please can anyone explain this to me

    Please can anyone explain this to me - thank you -
    Time Machine couldn't complete the backup to time capsule - The backup disk image “/Volumes/Data-1/Alyson’s iMac.sparsebundle” is already in use.

    The explanation is a long standing bug in Lion and Mountain Lion, but what you might really be asking is how to fix the problem.
    Pull the power cord from the back of the Time Capsule
    Wait a few minutes
    Plug the power cord back in
    If that does not fix the problem you will need to dig deeper.  See #C12 in Pondini's excellent Time Machine - Troubleshooting.
    http://pondini.org/TM/Troubleshooting.html

  • When i go to my music and play a song it sounds like my headphones are blown but when i play songs on youtube they sound fine, can anyone explain this to me? please and thank you

    when i go to my music and play a song it sounds like my headphones are blown but when i play songs on youtube they sound fine, can anyone explain this to me? please and thank you

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsync all music and resync
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up                                                                
    - Restore to factory settings/new iOS device.      

  • TS3988 I have an icloud account and I view my mail with Mail V5.2. I recieve my email but the senders get messages saying the delivery failed. Can anyone explain this or help me.

    I have an icloud account and I view my mail with Mail V5.2. I recieve my email but the senders get messages saying the delivery failed. Can anyone explain this or help me.

    Thank you for replying.    Yes I deleted the old email address..   

  • I went to silence my iPhone 5s and had a box pop up--looked like one of those boxes telling me turning on Location Services would help--telling me I needed to change my password within 60 minutes.....I turned the phone off.  Can anyone explain this to me?

    I went to silence my iPhone 5s and had a box pop up--looked like one of those boxes telling me turning on Location Services would help--telling me I needed to change my password within 60 minutes.....I turned the phone off.  Can anyone explain this to me?

    I went to silence my iPhone 5s and had a box pop up--looked like one of those boxes telling me turning on Location Services would help--telling me I needed to change my password within 60 minutes.....I turned the phone off.  Can anyone explain this to me?

  • HT1430 I downloaded the lateest update and I can't turn off my apps like I did on 6os. The 7os is different and I can't seem to find out if apps turn off now by just closing them. Can anyone explain this to me? Please

    I downloaded the lateest update and I can't turn off my apps like I did on 6os. The 7os is different and I can't seem to find out if apps turn off now by just closing them. Can anyone explain this to me? Please

    Double tap the Home button and swipe the app preview page up
    iOS 7  also allows apps to run while they aren't open.
    You can manage these here:
    Settings > General > Background App Refresh

  • Daemon Threads: Can you explain this behaviour

    Hey All,
    Please refer to code segment given below. As per the defination of Daemon threads it should terminate when all other user threads die. In this case it should terminate when main thread ends as thread2 has not been initiated yet.
    The result is not consistent. We get the expected output sometimes, whereas sometimes program goes in to an infinite loop and other times excutes a few lines of thread2 and then quits.
    Can someone explain this?
    Thank you
    Vidur Gupta
    class simpleThread extends Thread
         public void run()
              System.out.println("Thread 1 daemon starts");
              babyThread thread2 = new babyThread(); //Thread2 created
              thread2.setDaemon(false); //Thread2 daemon=false
              thread2.start();          
              System.out.println("Thread 1 daemon status= "+ this.isDaemon());
              System.out.println("Thread 1 ends"); //thread1 ends
    class babyThread extends Thread
         public void run()
              System.out.println("Thread 2 starts");
              while(true) //Thread2 goes in to an infinite loop
              System.out.println("Thread 2 daemon status= "+ this.isDaemon());
    public class daemon
         public static void main(String[] args) //Main
              int i=0;
              simpleThread thread1= new simpleThread(); //Create thread1
              thread1.setDaemon(true); //Set Thread1 as Daemon
              thread1.start();
              while(i<1000000)
                   i++;
              System.out.println("Thread Main ends"); //Main ends
    }

    It's not clear what behavior you expect, or what behavior you're observing, but here's what I would expect to happen:
    thread1.start() is called.
    After that, either of two things could happen:
    1) the main thread could go into your very short spinlock counting up to 1000000
    OR
    2) thread1 starts running
    You can't predict or control which one of those happens, and it may be that on successive runs of your program, one happens sometimes and the other one happens other times.
    At some point, you'll get to where the main thread dies. If the only other thread that has been started is thread1, then, since it's a deamon, the program will die.
    However, it may be that sometimes that happens, and other times, thread1 gets enough CPU time to call thread2.start(). You may not see any output from thread2 or see the ""Thread 1 daemon status" output that comes right after t2.start() before main ends, but if t2 has been started, then you've got another non-deamon.
    Bottom line: Whether or not there's an additional non-deamon besides main depends on how the scheduler happens to schedule your threads, and you should not expect that to be consistent or predictable.

  • Multithreading - Can someone explain this ...

    Hi Java Gurus:
    Can someone explain this to me why my multithreading worked in once case and not in the other.
    First a little background:
    My application lets the user create multiple JInternalFrames. Each frame has an OK button. When the user presses the OK button, the frame goes about it's business in a new thread, thus returning control to the use, so he/she can press the OK button on the second frame .. and so on.
    Following is the event handler for the OK button that creates the new thread:
    case1 - doesn't work:
          btnTranslate.addActionListener(
             new ActionListener() {
                public void actionPerformed( ActionEvent e ) {
                             txtOutput.setText("");
                             txtBadParts.setText("");
                   Translation trans = new Translation(inst);
                   trans.run();
          );case2 - works:
          btnTranslate.addActionListener(
             new ActionListener() {
                public void actionPerformed( ActionEvent e ) {
                             txtOutput.setText("");
                             txtBadParts.setText("");
                       new Translation(inst).start();
          );Thanks,
    Kamran

    Calling the run method makes the run method run in the current thread. You need to call the start method to get the thread to start its own thread.

  • Post Moved Can anyone explain this baffling puzz...

    Post moved to Other BB Queries http://community.bt.com/t5/Other-BB-Queries/Can-anyone-explain-this-baffling-puzzle-with-BT-Total-BB...
    If you want to say thanks for a helpful answer,please click on the Ratings star on the left-hand side If the reply answers your question then please mark as ’Mark as Accepted Solution’

    I tend to think that the comments about MAC address filtering and wireless security are a bit misleading - if these things were the problem then it would not work at all as opposed to working sporadically.
    I must admit, reading your post I had exactly the same problem moving into a new house last year, my desktop PC in my room would get terrible wireless reception with constant erroring and was practically unusable whilst a laptop sat next to it was just fine. I tried a million different things and eventually bought an external wireless antenna like the one here:
    Edimax EA-IO7D 7dBi Indoor Omni-Directional High Gain Antenna with Desktop Stand - 1m Cable
    It solved the problem for me though I am still mystified as to what the problem is - I suspect that there is something in the environment causing interference though I don't know what. My house is of average size and fairly modern with thin walls so I would not anticipate any problems.
    Some things to try are to move the PC right next to the hub (or vice versa, whichever is easier) and see if this improves things or borrow a wireless router from a friend, turn off all encryption and see what signal strength you get there.

  • How can i replicate this images drop shadow exactly

    How can i replicate this images drop shadow exactly from scratch
    http://i52.tinypic.com/2u41t7n.jpg
    If this sort of thing is not covered on this forum please direct me to an off site forum that would help me with this graphics question

    Trial and error, putting both the reference image and your new experimental image up side by side, is the only way I know.  I'd probably use the Info panel as well, to see that I'm getting the same or very similar color numbers from the new drop shadow.
    You can probably use the Magic Wand set to a very low tolerance value to select and copy the light colored object, then make a new document with a white background, paste in the copied object, then start experimenting with drop shadow.  Alternatively you could just redraw a portion of it.
    -Noel

  • The home button has stopped working on my iphone 5c. Did the same a few months ago and recovered 24hrs later. Can anyone explain this problem. Phone still in warranty. Had steam issue recently but this was after last home button episode.

    Have an iphone 5c 8g. The home button has stopped working. Did the same a few months ago and recovered 24hrs later. Can anyone explain this problem. Phone still in warranty. Had steam issue recently but this was after last home button episode and no evidence of damage.

    If you are playing in hockey arenas a lot or if you are bringing it into bathroom same time as shower it may not seem like much but overtime the steam can acquire and build up in the phones usb dock flex cable swell as the home button flex cable. Bring again into apple store and should be covered under warranty again. could also be a delay in a 8gb 5c software may just be very lag.

Maybe you are looking for

  • Work order to cost center settlement does not post to GL module (FI)

    Dear Expert, I find the Maintenance Work order to cost center settlement does not post to GL module (FI)?Also, the settlement cost element is primary element define in GL chart of account. When an maintenance order is settled with KO88 or KO8G the wo

  • Help combining output data from an HP4140B and a LakeShore 330

    Hi! First of all, I would like to apologize if this question has already been answered in the forums, but I haven't been able to find anything for this particular situation... I am using LabView v.8.6 so as to conduct TSC (thermally stimulated curren

  • New Nikon D3100... Can't view NEF files in Bridge?!

    Hi guys, I have just purchased a Nikon D3100, taken some snaps and tried to view them using Adobe Bridge. Unfortunately I only get the NEF icon and when I try to open in Photoshop the file is not recognised. I have attempted to follow numerous discus

  • If I have Logic Pro 7, can I install it on a Snow leopard system?

    I may be considering buying a Macbook Pro and I want to upgrade to Logic 9. However i don't want to have to shewll out £400 if I can just install Logic 7 and then upgrade to Logic Pro 9 for £163. Please let me know if this is possible with Snow Leopa

  • Problem with new template

    Hi - I am a "dreamweaver rookie". I have a dreamweaver site that I wanted to give a facelift to. So I downloaded a template from a template business on the net, and completely edited it in dreamweaver. When I try to replace the old site, the only thi