This library aims to provide efficient implementation and detaile debugging of solutions to problems in the asynchronous domain.
Project description
Parallel Timing Library
This library that aims to decrease the latency of shared-memory-based communication between asynchronous processes in Python. The common practice for sharing data between parallel processes is using a Python standard library multiprocessing Queue-like data structure. However, this requires that the data be serialized and transferred over a local socket, leading to a significant bottleneck when dealing with large data structures. I have been able to decrease this latency by leveraging the multiprocessing SharedMemory class added to the standard library with the release of Python 3.8. This addition allows the user to allocate bytes in memory and directly read/write to a buffer without serializing data. As it currently stands, implementing this requires an intimidating amount of familiarity with multiprocessing. I aim to abstract most of the heavy lifting in this library with the hope of increasing the readability and efficiency of asynchronous pipelines.
- tests show that ptlib.Queue can be more than 50 times faster than multiprocessing.Queue.
TODO
-
implement option to directly specify job spec
-
infer job by passing a list into
output_job, have job map assign indices like before, and then iterate over jobs and infer shape -
write job to be a dict. overload set item and make sure assignment fills
-
save key of job in job spec
-
pass in output and input job buffers when job map is created
-
refer to embedded jobs as subjobs?
-
overload getitem for jobinfer such that the first assignment allows for something immutable
-
create requirements file
-
way to implement task order non linear pipelines
-
document the code lol
-
get rid of unused imports
-
remove duplicated code from controller
_set_up_tasks -
fix task job map documentation
-
create way to specify spec in typing. for ex, job: Job[JobSpec]
-
create several objects in _typing
-
*** instead of creating controller, decorate tasks
-
*** CHANGE queue to hold selection index until job is done so we dont have to copy data from buffer
-
*** have put copy directly to output buffer (this may mean locking down output buffer before task starts)
-
*** try to figure out optimal worker numbers under constraints
-
*** instead of having several buffers for several I/O, have one buffer and keep track of the offset and number of bytes
-
*** add way to enable/disable metadata
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ptlib-0.0.5.tar.gz.
File metadata
- Download URL: ptlib-0.0.5.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cf18d62b0f07e1b411f43f448027b9056c24e7cae2d843072c19d2743b1e9f8
|
|
| MD5 |
e3c7e65aa654729fd3652071264c77b5
|
|
| BLAKE2b-256 |
e2552d62597873150c4796cb20354a69649809cd34aa87b4cbd6cfb59fe200d5
|
File details
Details for the file ptlib-0.0.5-py3-none-any.whl.
File metadata
- Download URL: ptlib-0.0.5-py3-none-any.whl
- Upload date:
- Size: 19.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eeeaf9d40fba38450998752e6534be3cfd95251b369f4dc162a28f1aa2cfb711
|
|
| MD5 |
25a2f18b587b517c26ffb47dcaf09cf1
|
|
| BLAKE2b-256 |
59bc07141603895317c9f5ea28b728634098993530d110210eacbe92a80c3236
|