Name | fastqueue-lib JSON |
Version |
0.0.16
JSON |
| download |
home_page | |
Summary | Fast single ended queue library for python |
upload_time | 2023-09-06 17:28:57 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.7 |
license | |
keywords |
queue
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# fastqueue
[](https://github.com/MatthewAndreTaylor/fastqueue/actions)
[](https://github.com/MatthewAndreTaylor/fastqueue/)
[](https://github.com/MatthewAndreTaylor/fastqueue/blob/master/LICENSE)\
[](https://pypi.org/project/fastqueue-lib/)
Single ended fast queue's built in C tuned for python.
## Requirements
- `python 3.7+`
## Installation
To install fastqueue, using pip:
```bash
pip install fastqueue-lib
```
## Quickstart
For general use cases `fastqueue.Queue()` objects are tuned to perform well.
The enqueue and dequeue methods perform well over a large sequence of arbitrary operations.
`fastqueue.Queue()` supports many standard sequence methods similar to lists.
`fastqueue.Queue()` minimizes memory usage but maintains the fast queue speeds.
```py
>>> from fastqueue import Queue
>>> queue = Queue()
>>> queue.extend(['🚒', '🛴'])
>>> queue[0]
'🚒'
>>> '🛴' in queue
True
>>> queue.enqueue('🚅')
>>> queue.enqueue('🚗')
>>> queue[-1]
'🚗'
>>> [queue.dequeue() for _ in range(len(queue)) ]
['🚒', '🛴', '🚅', '🚗']
```
For more specialized cases `fastqueue.QueueC()` objects are tuned to perform well.
The interface for `fastqueue.QueueC()` is identical to `fastqueue.Queue()`.
The enqueue and dequeue methods perform similarly well over a large sequence of arbitrary operations.
`fastqueue.QueueC()` handles memory differently by doubling the capacity when full.
This increases the complexity but maintains fast amortized cost.
The benefit of this approach is even faster `__getitem__` and `__setitem__` speeds
```py
>>> from fastqueue import QueueC
>>> queue_c = QueueC()
>>> queue_c.extend(['🚒', '🛴'])
>>> queue_c[0]
'🚒'
>>> '🛴' in queue_c
True
>>> queue_c.enqueue('🚅')
>>> queue_c.enqueue('🚗')
>>> queue_c[-1]
'🚗'
>>> [queue_c.dequeue() for _ in range(len(queue_c)) ]
['🚒', '🛴', '🚅', '🚗']
```
Another alternative is `fastqueue.LockQueue()` which supports all queue operations.
`fastqueue.LockQueue()` is built as a thread-safe alternative to the other queue types.
## Example Benchmarks
### Queue operations
Ubuntu


Windows


### Iteration
Ubuntu


Windows


Raw data
{
"_id": null,
"home_page": "",
"name": "fastqueue-lib",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "Queue",
"author": "",
"author_email": "Matthew Taylor <matthew.taylor.andre@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/da/e3/97d9b76525d3516f15550aee5a4e0d483422a3c303a75b1cfc2cdb105781/fastqueue-lib-0.0.16.tar.gz",
"platform": null,
"description": "# fastqueue\n\n[](https://github.com/MatthewAndreTaylor/fastqueue/actions)\n[](https://github.com/MatthewAndreTaylor/fastqueue/)\n[](https://github.com/MatthewAndreTaylor/fastqueue/blob/master/LICENSE)\\\n[](https://pypi.org/project/fastqueue-lib/)\n\n\nSingle ended fast queue's built in C tuned for python.\n\n## Requirements\n\n- `python 3.7+`\n\n## Installation\n\nTo install fastqueue, using pip:\n\n```bash\npip install fastqueue-lib\n```\n\n## Quickstart\n\nFor general use cases `fastqueue.Queue()` objects are tuned to perform well.\nThe enqueue and dequeue methods perform well over a large sequence of arbitrary operations.\n`fastqueue.Queue()` supports many standard sequence methods similar to lists.\n`fastqueue.Queue()` minimizes memory usage but maintains the fast queue speeds.\n\n```py\n>>> from fastqueue import Queue\n>>> queue = Queue()\n>>> queue.extend(['\ud83d\ude92', '\ud83d\udef4'])\n>>> queue[0]\n'\ud83d\ude92'\n>>> '\ud83d\udef4' in queue\nTrue\n>>> queue.enqueue('\ud83d\ude85')\n>>> queue.enqueue('\ud83d\ude97')\n>>> queue[-1]\n'\ud83d\ude97'\n>>> [queue.dequeue() for _ in range(len(queue)) ]\n['\ud83d\ude92', '\ud83d\udef4', '\ud83d\ude85', '\ud83d\ude97']\n```\n\n\nFor more specialized cases `fastqueue.QueueC()` objects are tuned to perform well.\nThe interface for `fastqueue.QueueC()` is identical to `fastqueue.Queue()`.\nThe enqueue and dequeue methods perform similarly well over a large sequence of arbitrary operations.\n`fastqueue.QueueC()` handles memory differently by doubling the capacity when full.\nThis increases the complexity but maintains fast amortized cost.\nThe benefit of this approach is even faster `__getitem__` and `__setitem__` speeds\n\n```py\n>>> from fastqueue import QueueC\n\n>>> queue_c = QueueC()\n>>> queue_c.extend(['\ud83d\ude92', '\ud83d\udef4'])\n>>> queue_c[0]\n'\ud83d\ude92'\n>>> '\ud83d\udef4' in queue_c\nTrue\n>>> queue_c.enqueue('\ud83d\ude85')\n>>> queue_c.enqueue('\ud83d\ude97')\n>>> queue_c[-1]\n'\ud83d\ude97'\n>>> [queue_c.dequeue() for _ in range(len(queue_c)) ]\n['\ud83d\ude92', '\ud83d\udef4', '\ud83d\ude85', '\ud83d\ude97']\n```\n\nAnother alternative is `fastqueue.LockQueue()` which supports all queue operations.\n`fastqueue.LockQueue()` is built as a thread-safe alternative to the other queue types.\n\n## Example Benchmarks\n\n### Queue operations\n\nUbuntu\n\n\n\n\nWindows\n\n\n\n\n### Iteration\n\n\nUbuntu\n\n\n\n\nWindows\n\n\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "Fast single ended queue library for python",
"version": "0.0.16",
"project_urls": {
"Homepage": "https://github.com/MatthewAndreTaylor/fastqueue"
},
"split_keywords": [
"queue"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bc7566720b3d4f8b1cc12a17542de73eba6714927200eb7f42361ecffbb6b0a9",
"md5": "b5ae41a9e463254753c1c8a1bda713ff",
"sha256": "9c24fe354abb9cd135c6a51cb1c020031736ce1c9dc5069e7a7bc2ff0a80d51f"
},
"downloads": -1,
"filename": "fastqueue_lib-0.0.16-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl",
"has_sig": false,
"md5_digest": "b5ae41a9e463254753c1c8a1bda713ff",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.7",
"size": 63169,
"upload_time": "2023-09-06T17:28:55",
"upload_time_iso_8601": "2023-09-06T17:28:55.974728Z",
"url": "https://files.pythonhosted.org/packages/bc/75/66720b3d4f8b1cc12a17542de73eba6714927200eb7f42361ecffbb6b0a9/fastqueue_lib-0.0.16-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dae397d9b76525d3516f15550aee5a4e0d483422a3c303a75b1cfc2cdb105781",
"md5": "c24ceb851307752d798aaf2350a0d7af",
"sha256": "65774eeda6841e0eb734900a63afa00840e5b65ac33dc9554095db68a538561c"
},
"downloads": -1,
"filename": "fastqueue-lib-0.0.16.tar.gz",
"has_sig": false,
"md5_digest": "c24ceb851307752d798aaf2350a0d7af",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 11815,
"upload_time": "2023-09-06T17:28:57",
"upload_time_iso_8601": "2023-09-06T17:28:57.855529Z",
"url": "https://files.pythonhosted.org/packages/da/e3/97d9b76525d3516f15550aee5a4e0d483422a3c303a75b1cfc2cdb105781/fastqueue-lib-0.0.16.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-06 17:28:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "MatthewAndreTaylor",
"github_project": "fastqueue",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "fastqueue-lib"
}