cogeotiff / rio-tiler-mosaic

A rio-tiler plugin for creating tiles from multiple observations.
MIT License
32 stars 6 forks source link

Optionally turn off multithreading #13

Closed kylebarron closed 4 years ago

vincentsarago commented 4 years ago

@kylebarron I'm not sure to remember what we agreed here, are we sure that futures.ThreadPoolExecutor(max_workers=1) is slower ?

kylebarron commented 4 years ago

slower than what? On Lambda it's faster than more threads.

vincentsarago commented 4 years ago

Is 'futures.ThreadPoolExecutor' with only 1 thread slower than using a for loop (_single_threaded)?

kylebarron commented 4 years ago

Oh I don't think I ever tested that, or if I did I can't remember what I found

vincentsarago commented 4 years ago

🤦 well in fact I did benchmark this https://github.com/vincentsarago/threadbench#1-image

So yeah not using threads seems faster!

kylebarron commented 4 years ago

Wow looking at those benchmarks again, not using threads vs a threadpool of 1 thread is significantly faster.

Did you use this PR for testing?

vincentsarago commented 4 years ago

@kylebarron nope I used a simple app https://github.com/vincentsarago/threadbench/blob/master/tests/test_benchmarks.py#L26-L52