Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Post - Optimise Python code for data preparation using Concurrent features
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
You can’t perform that action at this time.