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

github.com/perdata/trope

Package trope implements a simple rope-like datastructure for large immutable collections. Unlike a rope which uses binary trees, trope uses a dynamic branch factor. The data structure is mainly optimized for performance when a large number of edit operations are made. The underlying tree is not automatically rebalanced as most situations can do without this step. A Flatten() method is provided to construct a somewhat balanced tree in an efficient manner but this is not a true balancing. In particular, the number of nodes depends on the number of edits and the root node has unbounded branching factor. But in most practical sitations, this will work fine. The rope datastructure is often too expensive for fairly small arrays. The Hybrid type is defined to get the best of both worlds by using the regular array implementation for small counts and switching to the more complex structure at a configured high water mark. These benchmarks include 100 iterations of random slicing (on top of the previous result). The comparison is between trope.Node, trope.Hybrid and a simple string-slice based splice operation. String size of 5k: String size of 200k: The benchmarks are obviously specific to the hardware but it gives an idea about the relative performance characterestics.

Ecosystem
proxy.golang.org
Latest Release
v0.0.0-20180917080216-0e3aaf5f8ef0
over 7 years ago
Versions
1
Links
Registry proxy.golang.org
Source Repository
Docs Documentation
JSON API View JSON
CodeMeta codemeta.json
Package Details
PURL pkg:golang/github.com/perdata/trope
spec
License MIT
Namespace github.com/perdata
First Release over 7 years ago
Last Synced 21 days ago
Repository
Stars 2 on GitHub
Forks 1 on GitHub
Rankings on proxy.golang.org
Overall Top 8.2%