hi, i did some tests about performance in jspeex ... uls@mainframe:~/eclipse/avrelay$ java TestClient Diff1: 0 10 Diff2: 141 started. uls@mainframe:~/eclipse/avrelay$ <p>{ SpeexEncoder e1=new SpeexEncoder(); e1.init(0,1,44100,1); byte[] by1=new byte[320]; long l1=System.currentTimeMillis(); long l2=System.currentTimeMillis(); System.out.println("Diff1: "+(l2-l1)); e1.processData(by1,0,by1.length); System.out.println(e1.getProcessedDataByteSize()); l2=System.currentTimeMillis(); System.out.println("Diff2: "+(l2-l1)); System.out.println("started."); } <p>Is there a way to optimize this outstanding cruncher? thanks, ulrich --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
hi, Ulrich B. Staudinger wrote:> uls@mainframe:~/eclipse/avrelay$ java TestClient > Diff1: 0 > 10 > Diff2: 141 > started. > uls@mainframe:~/eclipse/avrelay$Sorry, i think this number (diff2) occured due to jvm startup load ... when doing repetive encoding the numbers are much closer to Marc's minimum requirements (with Diff being the elapsed time for encoding on my dual 350): uls@mainframe:~/eclipse/avrelay$ java TestClient 12 Diff: 149 24 Diff: 212 36 Diff: 18 48 Diff: 31 60 Diff: 10 72 Diff: 24 84 Diff: 9 96 Diff: 9 108 Diff: 23 120 Diff: 13 132 Diff: 10 144 Diff: 13 156 Diff: 17 168 Diff: 10 180 Diff: 9 192 Diff: 8 204 Diff: 9 216 Diff: 8 228 Diff: 18 240 Diff: 19 252 Diff: 17 264 Diff: 9 276 Diff: 24 288 Diff: 9 300 Diff: 8 312 Diff: 8 uls@mainframe:~/eclipse/avrelay$ java TestClient thanks, ulrich p.s. but now i wonder about those processed bytes ;-) (cause i used this number to allocate the byte arrays, which solves why the memory footprint constantly increased) .... --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
hi, here is test case one with original code (optimized code is at bottom of mail): Diff: 17 32 Diff: 15 32 Diff: 14 32 Diff: 14 32 Diff: 15 32 Diff: 15 32 Diff: 15 32 Diff: 17 32 Diff: 15 32 Diff: 15 32 Diff: 14 32 Diff: 14 32 Diff: 14 32 Diff: 15 32 Diff: 15 32 Diff: 99 32 Diff: 30 32 Diff: 14 32 Diff: 15 32 Diff: 16 32 Diff: 15 32 Diff: 16 32 Diff: 65 32 Diff: 45 32 Diff: 18 32 Diff: 43 root@mainframe:/home/uls/eclipse/avrelay# the diff clearly has spikes which go up to 60 ms ... now optimized code: Diff: 17 32 Diff: 15 32 Diff: 15 32 Diff: 15 32 Diff: 15 32 Diff: 15 32 Diff: 15 32 Diff: 15 32 Diff: 15 32 Diff: 17 32 Diff: 15 32 Diff: 15 32 Diff: 15 32 Diff: 15 32 Diff: 15 32 Diff: 15 32 Diff: 16 32 32 Diff: 18 32 Diff: 15 32 Diff: 15 32 Diff: 16 32 Diff: 15 32 Diff: 15 root@mainframe:/home/uls/eclipse/avrelay# much more stable at rates off about 16ms. changed code in SpeexEncoder.java: public int getProcessedData(byte[] data, int offset) { int size = bits.getBufferSize(); //System.arraycopy(bits.getBuffer(), 0, data, offset, size); <- this one is slow //better is a manual copy for(int i=0;i<size;i++){ data[i + offset]=bits.getBuffer()[i]; } bits.init(); return size; } <p>ulrich p.s. sorry for the last return reciepts ... --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.