Skip to content

v0.5.0b1

Choose a tag to compare

@TheGreatCabbage TheGreatCabbage released this 26 Feb 16:49
· 18 commits to master since this release

New features

  • With the new map() and map_blocking() functions, a scheduler can be called with a single line of code.
  • Shared memory is now supported for Numpy arrays on Python 3.8. This can provide substantial speed improvements when working with large arrays.

Mapping functions

See the documentation.

Shared memory

This feature is new, and may not be fully stable until a future release.

To enable it, use shared_memory=True when creating a Scheduler:

scheduler = Scheduler(shared_memory=True)

On Python 3.8, any Numpy arrays returned from a function added to a Scheduler will automatically be passed via shared memory if and only if shared memory is enabled and their size (arr.size) is greater than the shared_memory_threshold (which defaults to 1e7).

If multiple values are returned from a function, each value which is a Numpy array will be passed via shared memory if the above conditions are met for each array. Numpy arrays returned within a data structure, e.g. a list or dictionary, will not be passed via shared memory.

On Python 3.7 and below, Scheduler will fall back to the traditional Queue-based implementation even if shared memory is enabled.