-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance improvements #1
Conversation
In profiling a benchmark code this takes processing overhead from ~14% to ~1.4% and ~0.06% respectively
…ller than the whole screen. The idea is to ask ctypes.string_at for as little memory as possible. Since images are stored in memory with width being the fast index. If we want to grab a 480x640 region from a 1440x2560 screen we can ask ctypes.string_at() for a 480x2560 region. This reduces memory allocation and memcpy overhead in ctypes.string_at(). To grab a 480x640 region out of a 1440x2560 screen the profiler time spent went from ~24% to ~8%.
…tions of (90,180,270)
…ere its width region matches the screen's width.
…rom_address API instead. In profiling a 1440x2560 grab, total time spent went from 20% in string_at() to almost 0% in from_address. My understanding is that string_at uses memove which is slower than the memcpy I suspect from_address uses.
…that case self.region is used, and self.region was already validated when it was defined. In profiling a max FPS benchmark with no region defined, this spares 3% of total execution time.
… if statement bypassed the call to self.process_cvtcolor(). Simplify code in process_cvtcolor since it no longer needs to handle 'BGRA''. In profiling this spares 0.4% of total execution time in 'BGRA' mode.
…but it was producing a non-contiguous array, which changes the behavior of the library
Traceback (most recent call last): Hi I spoke agade about this issue and it seems to be related to your new release and not his source he has tested the python version 3.10 and had the same issue i tested python 3.11? |
I used CopySubresourceRegion maybe that's the issue comes from? But no issue on my computer at all... |
Forked from ra1nty#62.
Could you please create a compiled version of the above, pull requester states significant gains were made after optimisations would be great if you created a dxshot version.(Please include python 3.11)