- reduce allocations by making leaf a value type with a bool - make longestPrefix inlineable and have no bounds checks - delete any code for functions we don't plan to use - operate on []byte and only copy when necessary - inline calls to sort.Search to avoid allocations and indirections - insert directly in the correct location for addEdge - reduce allocations during copying with a buffer helper results: name old time/op new time/op delta Tree_Insert-8 1.10ms ± 4% 0.73ms ± 4% -33.54% (p=0.000 n=10+10) Tree_InsertNew-8 3.18ms ± 2% 1.91ms ± 6% -39.90% (p=0.000 n=10+10) name old speed new speed delta Tree_Insert-8 9.12MB/s ± 4% 13.72MB/s ± 4% +50.46% (p=0.000 n=10+10) Tree_InsertNew-8 3.15MB/s ± 2% 5.24MB/s ± 6% +66.42% (p=0.000 n=10+10) name old alloc/op new alloc/op delta Tree_InsertNew-8 1.62MB ± 0% 1.60MB ± 0% -1.28% (p=0.000 n=10+9) name old allocs/op new allocs/op delta Tree_InsertNew-8 35.0k ± 0% 15.0k ± 0% -57.04% (p=0.000 n=10+10) MB/sec in this case is 1 byte per key inserted, so it's really millions of keys inserted per second. |
||
---|---|---|
.. | ||
binaryutil | ||
bloom | ||
bytesutil | ||
deep | ||
escape | ||
estimator | ||
file | ||
limiter | ||
metrics | ||
mmap | ||
pool | ||
pprofutil | ||
radix | ||
rhh | ||
slices | ||
snowflake | ||
tar | ||
testing/assert | ||
tracing | ||
README.md |
README.md
pkg/ is a collection of utility packages used by the InfluxDB project without being specific to its internals.
Utility packages are kept separate from the InfluxDB core codebase to keep it as small and concise as possible. If some utilities grow larger and their APIs stabilize, they may be moved to their own repository under the InfluxDB organization, to facilitate re-use by other projects. However that is not the priority.
Because utility packages are small and neatly separated from the rest of the codebase, they are a good place to start for aspiring maintainers and contributors. Get in touch if you want to help maintain them!