https://github.com/vizonex/multifuture
A Synchronous Future Object that carries Asynchronous Children Written in Cython
https://github.com/vizonex/multifuture
asyncio concurrent-futures cpython cython python
Last synced: 15 days ago
JSON representation
A Synchronous Future Object that carries Asynchronous Children Written in Cython
- Host: GitHub
- URL: https://github.com/vizonex/multifuture
- Owner: Vizonex
- License: apache-2.0
- Created: 2025-08-14T02:37:09.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-08-16T19:40:53.000Z (11 months ago)
- Last Synced: 2025-08-29T08:49:59.700Z (11 months ago)
- Topics: asyncio, concurrent-futures, cpython, cython, python
- Language: C
- Homepage:
- Size: 55.7 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MultiFuture
A Faster implementation of concurrent.futures's Future object implemented using Cython with the added ability
to communicate between multiple different asyncio.Future objects. Name comes from and is inspired by [MultiDict](https://github.com/aio-libs/multidict)
This Future Object is meant to share bounds between asyncio future objects so that it is faster than `asyncio.wrap_future`
This also contains a recast hack for optimizing asyncio.Future objects using C via recasting objects.
Which so far is experimental but the results it has given have been quite promising.
It can also be used as a Cython Module and not just a Python Module.
## Benchmarks
Benchmarked on a Windows 10 Lenovo ideapad 1i w/ Intel Pentium using Python 3.10.18
| Task | MultiFuture | concurrent.futures.Future |
|---------|-------------|---------------------------|
| 1000000 set/get results | 0.593 sec | 7.896 sec |