Search Results

Search found 4 results on 1 pages for 'halfwarp'.

Page 1/1 | 1 

  • Converting to a column oriented array in Java

    - by halfwarp
    Although I have Java in the title, this could be for any OO language. I'd like to know a few new ideas to improve the performance of something I'm trying to do. I have a method that is constantly receiving an Object[] array. I need to split the Objects in this array through multiple arrays (List or something), so that I have an independent list for each column of all arrays the method receives. Example: List<List<Object>> column-oriented = new ArrayList<ArrayList<Object>>(); public void newObject(Object[] obj) { for(int i = 0; i < obj.length; i++) { column-oriented.get(i).add(obj[i]); } } Note: For simplicity I've omitted the initialization of objects and stuff. The code I've shown above is slow of course. I've already tried a few other things, but would like to hear some new ideas. How would you do this knowing it's very performance sensitive?

    Read the article

  • Stopping looping thread in Java

    - by halfwarp
    I'm using a thread that is continuously reading from a queue. Something like: public void run() { Object obj; while(true) { synchronized(objectsQueue) { if(objectesQueue.isEmpty()) { try { objectesQueue.wait(); } catch (InterruptedException e) { e.printStackTrace(); } obj = objectesQueue.poll(); } } // Do something with the Object obj } } What is the best way to stop this thread? I see two options: 1 - Since Thread.stop() is deprecated, I can implement a stopThisThread() method that uses a n atomic check-condition variable. 2 - Send a Death Event object or something like that to the queue. When the thread fetches a death event it exists. I prefer the 1st way, however, I don't know when to call the stopThisThread() method, as something might be on it's way to the queue and the stop signal can arrive first (not desirable). Any suggestions?

    Read the article

  • JVM hs_err.log not being generated on Linux

    - by halfwarp
    Hello, I'm currently having some issues with a Java application I'm developing. Namely the JVM is crashing with a segfault. I'm trying to locate the hs_err.log file which should contain some helpful info about the issue. However, I can't find this file. I've used find, locate, etc, and nothing. Any ideas on why the log file isn't being generated?

    Read the article

  • Java generic Interface performance

    - by halfwarp
    Simple question, but tricky answer I guess. Does using Generic Interfaces hurts performance? Example: public interface Stuff<T> { void hello(T var); } vs public interface Stuff { void hello(Integer var); <---- Integer used just as an example } My first thought is that it doesn't. Generics are just part of the language and the compiler will optimize it as though there were no generics (at least in this particular case of generic interfaces). Is this correct?

    Read the article

1