An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 1.3% on proxy.golang.org
Top 0.1% dependent packages on proxy.golang.org
Top 0.2% dependent repos on proxy.golang.org
Top 3.4% forks on proxy.golang.org
Top 0.1% docker downloads on proxy.golang.org

proxy.golang.org : github.com/gammazero/deque

Package deque provides a fast ring-buffer deque (double-ended queue) implementation. Deque generalizes a queue and a stack, to efficiently add and remove items at either end with O(1) performance. Queue (FIFO) operations are supported using PushBack and PopFront. Stack (LIFO) operations are supported using PushBack and PopBack. The ring-buffer automatically resizes by powers of two, growing when additional capacity is needed and shrinking when only a quarter of the capacity is used, and uses bitwise arithmetic for all calculations. The ring-buffer implementation significantly improves memory and time performance with fewer GC pauses, compared to implementations based on slices and linked lists. For maximum speed, this deque implementation leaves concurrency safety up to the application to provide, however the application chooses, if needed at all. Since it is OK for the deque to contain the zero-value of an item, it is necessary to either panic or return a second boolean value to indicate the deque is empty, when reading or removing an element. This deque panics when reading from an empty deque. This is a run-time check to help catch programming errors, which may be missed if a second return value is ignored. Simply check Deque.Len() before reading from the deque. Deque uses generics to create a Deque that contains items of the type specified. To create a Deque that holds a specific type, provide a type argument with the Deque variable declaration.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/gammazero/deque
Keywords: circular-buffer , circular-queue , deque , queue , ring-buffer
License: MIT
Latest release: over 2 years ago
First release: about 4 years ago
Namespace: github.com/gammazero
Dependent packages: 4,601
Dependent repositories: 1,359
Stars: 621 on GitHub
Forks: 59 on GitHub
Docker dependents: 1,296
Docker downloads: 1,470,757,966
Total Commits: 49
Committers: 5
Average commits per author: 9.8
Development Distribution Score (DDS): 0.449
More commit stats: commits.ecosyste.ms
See more repository details: repos.ecosyste.ms
Last synced: 6 months ago

    Loading...
    Readme
    Loading...