Skip to content

Commit

Permalink
Make BufferedImageFactory.fromNDArray synchronous (#1339)
Browse files Browse the repository at this point in the history
Found that it gives some performance improvement.
  • Loading branch information
zachgk authored Nov 2, 2021
1 parent 11d4013 commit 518cadc
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ public Image fromNDArray(NDArray array) {
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
int[] raw = array.toUint8Array();
IntStream.range(0, imageArea)
.parallel()
.forEach(
ele -> {
int x = ele % width;
Expand All @@ -127,7 +126,6 @@ public Image fromNDArray(NDArray array) {
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
int[] raw = array.toUint8Array();
IntStream.range(0, imageArea)
.parallel()
.forEach(
ele -> {
int x = ele % width;
Expand Down

0 comments on commit 518cadc

Please sign in to comment.