Skip to content

Instantly share code, notes, and snippets.

@vedranmarkulj
Created November 4, 2018 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vedranmarkulj/62e70d928632f3089da2eeaf6eccceb1 to your computer and use it in GitHub Desktop.
Save vedranmarkulj/62e70d928632f3089da2eeaf6eccceb1 to your computer and use it in GitHub Desktop.
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