Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oneofone/segmentedslice
A fast, index-able, sort-able, grow-only Slice.
https://github.com/oneofone/segmentedslice
Last synced: about 5 hours ago
JSON representation
A fast, index-able, sort-able, grow-only Slice.
- Host: GitHub
- URL: https://github.com/oneofone/segmentedslice
- Owner: OneOfOne
- License: apache-2.0
- Created: 2017-01-21T20:08:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-10T17:21:44.000Z (over 7 years ago)
- Last Synced: 2024-06-20T00:41:04.633Z (5 months ago)
- Language: Go
- Size: 19.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SegmentedSlice [![GoDoc](http://godoc.org/github.com/OneOfOne/segmentedSlice?status.svg)](http://godoc.org/github.com/OneOfOne/segmentedSlice) [![Build Status](https://travis-ci.org/OneOfOne/segmentedSlice.svg?branch=master)](https://travis-ci.org/OneOfOne/segmentedSlice)
A fast, index-able, sort-able, grow-only Slice.## FAQ
### Why?
* Appending to a normal slice can get slow and very memory heavy as the slice grows,
and for a lot of work loads it's usually append-only with some sorting.## Benchmarks
```go
➤ go18 test -bench=. -benchmem -benchtime=5s
BenchmarkAppendSegmentedSlice-8 200000000 42.4 ns/op 25 B/op 1 allocs/op
BenchmarkAppendNormalSlice-8 20000000 252 ns/op 88 B/op 1 allocs/op
PASS
ok github.com/OneOfOne/segmentedSlice 20.752s
```