Bug 578739 - Optimize ImageLoader copy to ByteArrayOutputStream

Testing was done using three images. A simple screenshot (230kB), and
two satellite image samples (15MB and 50MB) from
https://effigis.com/en/solutions/satellite-images/satellite-image-samples/.
Testing was conducted by timing in code how long the loop in the
original code took, and then how long the transferTo() call took.

By using transferTo(), instead of a loop the following speed
improvements were seen:

1) On the 230kB file, loading was 20.7% faster
2) On the first 15MB Thailand satellite image, loading was 25% faster
3) On the 50MB Germany satellite image, loading was 22.7% faster

Change-Id: I8042d7ded51444d4e6fffeca1ac2c5f6be5ad05a
Signed-off-by: Joel Majano <jmajano@redhat.com>
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/190786
Tested-by: Alexander Kurtakov <akurtako@redhat.com>
Reviewed-by: Alexander Kurtakov <akurtako@redhat.com>
1 file changed
tree: e425babebf4bf5e89f7f3d7a7a4eae386f7fefca
  1. bundles/
  2. container/
  3. examples/
  4. features/
  5. local-build/
  6. tests/
  7. .gitattributes
  8. .gitignore
  9. CONTRIBUTING
  10. Jenkinsfile
  11. LICENSE
  12. NOTICE
  13. pom.xml
  14. README.md
README.md

Contributing to SWT

Thanks for your interest in this project.

Developer resources:

See the following description for how to contribute a feature or a bug fix to SWT.

Information regarding source code management, builds, coding standards, and more and be found under the following link.

Contributor License Agreement:

Before your contribution can be accepted by the project, you need to create and electronically sign the Eclipse Foundation Contributor License Agreement (CLA).

Contact:

Contact the project developers via the project's “dev” list.

Search for bugs:

This project uses Bugzilla to track ongoing development and issues.

Create a new bug:

Be sure to search for existing bugs before you create another one. Remember that contributions are always welcome!