Crates.io | pinned-deque |
lib.rs | pinned-deque |
version | 0.2.0 |
source | src |
created_at | 2024-09-09 16:20:41.971434 |
updated_at | 2024-10-19 14:59:49.936448 |
description | A high-performance double-ended queue, inspired by BOOST deque. Every element in this deque is pinned until its popping. |
homepage | |
repository | https://github.com/TimeExceed/pinned-deque |
max_upload_size | |
id | 1369471 |
size | 110,067 |
This is a high-performance double-ended queue, inspired by BOOST deque. Once an element is pushed into this queue, it will never move until it is popped. So, pointers to elements in this queue will never be invalidated when other elements are pushed or popped.
Operation | Complexity |
---|---|
push_front/push_back | O(1) |
pop_front/pop_back | O(1) |
front/front_mut | O(1) |
back/back_mut | O(1) |
get/get_mut | O(1) |
iter/iter_mut | O(1) |
next in Iter/IterMut | O(1) |
next_back in Iter/IterMut | O(1) |
NOTICE: It is important to run benchmarks in your environement, especially under your allocator. Our results are collected under jemalloc.
In most cases, this deque is among the best choices.
get
/get_mut
) takes constant time, it is not as fast as Vec and VecDeque.
It is about 10x slower.