Poor performance of concurrent Graphics.RotateTransform operations

心已入冬 提交于 2019-12-01 11:04:33
George Duckett

The problem is that those GDI+ calls block per process (not per thread), so even though the threads are running in parallel, the calls to graphics.... cause other threads to block. Meaning it ends up processing nearly serially.

See various answers in the question below for workarounds, the top one suggesting creating separate processes. Looks like you might end up just creating a helper command line utility or something. You might even be able to get fancy hook up the stdin and stdout so you could pass the image to rotate and get back the new image with out IO operations.

Parallelizing GDI+ Image Resizing .net

I do not have a answer but some thoughts that may help:

  1. Are your threads running on multiple processors?
  2. How are you measuring performance? Remember that the UI rendering is always single threaded.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!