File tree Expand file tree Collapse file tree 5 files changed +15
-8
lines changed
Expand file tree Collapse file tree 5 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 9090 coverage-macos :
9191 runs-on : macos-12
9292 name : Coverage(macOS)
93+ env :
94+ TEST_DECODE_THREADS : 0 # Till `brew` update to `1.14.1`
9395
9496 steps :
9597 - uses : actions/checkout@v3
@@ -188,6 +190,8 @@ jobs:
188190 coverage-pi-heif :
189191 runs-on : macos-12
190192 name : Pi-Heif Coverage(macOS)
193+ env :
194+ TEST_DECODE_THREADS : 0 # Till `brew` update to `1.14.1`
191195
192196 steps :
193197 - uses : actions/checkout@v3
@@ -236,6 +240,7 @@ jobs:
236240 env :
237241 EXP_PH_LIBHEIF_VERSION : " "
238242 PH_LIGHT_ACTION : 1
243+ TEST_DECODE_THREADS : 0 # Till `brew` update to `1.14.1`
239244
240245 steps :
241246 - uses : actions/checkout@v3
Original file line number Diff line number Diff line change 8080 CIBW_BUILD : " *-macosx_x86_64"
8181 CIBW_SKIP : " cp36-* pp39-*"
8282 CIBW_TEST_SKIP : " cp311-*"
83- CIBW_ENVIRONMENT_MACOS : PH_LIGHT_ACTION=1
83+ CIBW_ENVIRONMENT_MACOS : PH_LIGHT_ACTION=1 TEST_DECODE_THREADS=0
8484
8585 - name : Checking built wheels
8686 run : |
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ jobs:
106106 CIBW_BUILD : " *-macosx_x86_64"
107107 CIBW_SKIP : " cp36-* pp39-*"
108108 CIBW_TEST_SKIP : " cp311-*"
109- CIBW_ENVIRONMENT_MACOS : PH_FULL_ACTION=1
109+ CIBW_ENVIRONMENT_MACOS : PH_FULL_ACTION=1 TEST_DECODE_THREADS=0
110110
111111 - name : Check built wheels
112112 run : |
Original file line number Diff line number Diff line change 66DECODE_THREADS = 4
77"""Maximum number of threads to use for decoding images(when it is possible)
88
9- When use pillow_heif as a plugin you can set it with: `register_*_opener(decode_threads=8)`"""
9+ When use pillow_heif as a plugin you can set it with: `register_*_opener(decode_threads=8)`
10+
11+ .. note:: Currently do not work on macOS, will be fixed in `0.9.1` version"""
1012
1113
1214THUMBNAILS = True
Original file line number Diff line number Diff line change @@ -83,12 +83,12 @@ def test_decode_threads():
8383 start_time_one_thread = perf_counter ()
8484 open_heif (test_image , convert_hdr_to_8bit = False ).load ()
8585 total_time_one_thread = perf_counter () - start_time_one_thread
86- options .DECODE_THREADS = 2
87- start_time_two_threads = perf_counter ()
86+ options .DECODE_THREADS = os . cpu_count ()
87+ start_time_multiply_threads = perf_counter ()
8888 open_heif (test_image , convert_hdr_to_8bit = False ).load ()
89- total_time_two_threads = perf_counter () - start_time_two_threads
90- # decoding in two threads should be faster at least by 8 %
91- assert total_time_one_thread > total_time_two_threads * 1.08
89+ total_time_multiply_threads = perf_counter () - start_time_multiply_threads
90+ # decoding in multiply threads should be faster at least by 15 %
91+ assert total_time_one_thread > total_time_multiply_threads * 1.15
9292 finally :
9393 options .DECODE_THREADS = 4
9494
You can’t perform that action at this time.
0 commit comments