On Fri, 11 Aug 2023 17:19:40 GMT, Alexander Zvegintsev <azveg...@openjdk.org> wrote:
> Right now, each call to getPixelColor/createScreenCapture opens and closes a > ScreenCast session. > When there are many such calls in a row, it becomes a rather time-consuming > operation. > > For example, > > > for (int i = 0; i < 50; i++) { > for (int j = 0; j < 50; j++) { > robot.getPixelColor(i, j); > } > } > > `50x50 took 375219ms` > > This fix offers optimization by keeping the session open and closing it only > 2 seconds after the last activity. > > `50x50 took 28113ms` which is ~ 13 times faster. > > Testing looks good. This pull request has now been integrated. Changeset: 2f04bc5f Author: Alexander Zvegintsev <azveg...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/2f04bc5f934887029d8bcc13cf722d8498a35120 Stats: 171 lines in 7 files changed: 121 ins; 23 del; 27 mod 8313697: [XWayland][Screencast] consequent getPixelColor calls are slow 8310334: [XWayland][Screencast] screen capture error message in debug Reviewed-by: serb, prr ------------- PR: https://git.openjdk.org/jdk/pull/15250