[GitHub] [poi] MariusVolkhart opened a new pull request #209: Improve performance of Bitmap#setData

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [poi] MariusVolkhart opened a new pull request #209: Improve performance of Bitmap#setData

GitBox

MariusVolkhart opened a new pull request #209:
URL: https://github.com/apache/poi/pull/209


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] [poi] centic9 commented on pull request #209: Improve performance of Bitmap#setData

GitBox

centic9 commented on pull request #209:
URL: https://github.com/apache/poi/pull/209#issuecomment-748481529


   Just wondering as we did various performance benchmarks over time, do you actually see these things causing performance issues? If yes, can you share some details about it?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] [poi] MariusVolkhart commented on pull request #209: Improve performance of Bitmap#setData

GitBox
In reply to this post by GitBox

MariusVolkhart commented on pull request #209:
URL: https://github.com/apache/poi/pull/209#issuecomment-787563131


   @centic9 No, we have not seen these as hotspots. Just things I come across as I'm becoming more familiar with the internals. Closing this as it was part of https://github.com/apache/poi/commit/d1c9a07860e365db4e335d24ad67e87544bdcceb


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] [poi] MariusVolkhart closed pull request #209: Improve performance of Bitmap#setData

GitBox
In reply to this post by GitBox

MariusVolkhart closed pull request #209:
URL: https://github.com/apache/poi/pull/209


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[GitHub] [poi] centic9 commented on pull request #209: Improve performance of Bitmap#setData

GitBox
In reply to this post by GitBox

centic9 commented on pull request #209:
URL: https://github.com/apache/poi/pull/209#issuecomment-788094928


   It's fine,  "new ByteArrayOutputStream(int size)" would allow to populate the stream without additional allocation, but toByteArray() performs a full array-copy again, so doing it ourselves should avoid this additional copying.
   
   In one of my projects I use the following helper class which avoids all the manual array-positioning and copying yourself and keeps using the ByteArrayOutputStream.
   
   ```
   class NonCopyingByteArrayOutputStream extends ByteArrayOutputStream {
    public NonCopyingByteArrayOutputStream(int size) {
    super(size);
    }
   
    public synchronized byte[] toByteArrayDirect() {
    return buf;
    }
   }
   ```
   
   In general I find it useful to verify such changes with results "before" and "after" via some tests as sometimes the JDK applies complicated optimizations which can cause changes to actually cause a slowdown.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]