simpleframework icon indicating copy to clipboard operation
simpleframework copied to clipboard

System.arraycopy Improvement possible in FrameEncoder

Open minborg opened this issue 9 years ago • 1 comments

In org.simpleframework.http.socket.service.FrameEncoder ->

     for(int i = 0; i < data.length; i++) {
        message[i + 2] = data[i];
     }

and

  for (int i = 0; i < count; i++) {
     reply[i] = header[i];
  }
  for (int i = 0; i < length; i++) {
     reply[i + count] = data[i];
  }

Could be made using System.arraycopy instead.

minborg avatar May 01 '15 21:05 minborg

Ya, this would likely improve the performance. I plan to use DirectByteBuffer internally in a future release, this should give a significant boost to performance.

ngallagher avatar May 25 '15 15:05 ngallagher