pye57 icon indicating copy to clipboard operation
pye57 copied to clipboard

Add allowParallel option

Open nh2 opened this issue 1 year ago • 4 comments

Draft PR for in-review libE57Format feature to allow parallel read access to the same E57 handle, e.g. with Python's ThreadPoolExecutor: https://github.com/asmaloney/libE57Format/pull/292

TODO

  • [ ] Once https://github.com/asmaloney/libE57Format/pull/292 is merged, remove the submodule change

nh2 avatar Jun 16 '24 22:06 nh2

Looks interesting! It would be cool to have a unit test for this and as noted it is important to remove the submodule change before merging. What are the performance implications?

dancergraham avatar Jun 17 '24 06:06 dancergraham

There may also be some work required to bring pye57 up to date with other changes in Libe57format, particularly if this lands as part of a major revision.

dancergraham avatar Jun 17 '24 09:06 dancergraham

What are the performance implications?

The only one we know of is that you can now use multiple threads for reading data out of the same E57.

Which can produce big speedups when being IO-bound by a single thread (e.g. when on a striped RAID or network file system, reading with N threads can be up to N times faster).

(Of course one could also open the same E57 multiple times to get parallel read access, but it's less convenient because there are more open file handles, and one needs to write the code in a coarser way instead of being able to use it locally in a function which has an already-opened E57.)

nh2 avatar Jun 17 '24 15:06 nh2

free threading is available as a build flag on python 3.13 - I wonder how that would interact with this feature?

dancergraham avatar Oct 04 '24 10:10 dancergraham