-
-
Save vedranmarkulj/62e70d928632f3089da2eeaf6eccceb1 to your computer and use it in GitHub Desktop.
Post - Optimise Python code for data preparation using Concurrent features
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import concurrent.futures | |
import time | |
import glob | |
from compressing import compres | |
start_time = time.time() | |
list_files = glob.glob("../data/test_compres/*.png") | |
with concurrent.futures.ProcessPoolExecutor(max_workers=4) as executor: | |
executor.map(compres.compress_image, list_files) | |
end_time = time.time() | |
print(end_time - start_time) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment