npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

lib-rrbit

v2.0.12-beta

Published

core operations for use on relaxed radix balanced vectors

Readme

lib-rrbit

styled with prettier is a set core operations and helpers for use on Vectors(i.e Arrays) implementing a Relaxed-Radix-Balance technique from the 2015 paper

this library adopts a Bring-Your-Own base factory(class) to easily allow seamless integrations across multiple environments.

If your looking for a immutable collection implementation, considering looking at our sister project instead: rrbit-js

About

lib-rrbit aims to ease your transition to immutable collections, by letting you decide the API for you needs, while handling all the bit-fiddling and dark magic of persistence algorithms behind the scenes. A typical well rounded List class can be quickly put together in less than 300 LOC, while adding around 10k(unminified) to your project.

Want your List's to return Optionals or Maybes instead of nulls? try it!

Need a List API that mimic's your your platform's (e.g. Java's ArrayList or Elm's Array), knock it out in an afternoon!

This project hope to bring more options to JS that help make it easy to focus on business logic and worry less about shared mutable state

Advantages

Every data structure has advantages and disadvantages depending on the use case. RRB data structures offer several unique advantages:

  • immutable every operations returns a new Vector
  • structural sharing Vectors safely share internal data, minimizing memory usage. Great for historical use cases(e.g. undo/redo stacks)
  • efficient prepend AND appends Vectors apply changes to an internal local cache or "focus" before merging them into the trie. instead of using a "tail" or "head", we use a movable "focus"

Great for queues

  • fast splitting slicing operations only require a trimming of indexes, no array copy required!
  • fast concat appending operations can often be completed with only and index update, requiring extremely little to no array copying

Operations

rrbit only provides a few operations to perform on Vectors efficiently. All other collection operations can be build from these:

  1. append - adds a single element
  2. update - updates a single
  3. take - keep first n elements, deleting everything after
  4. drop - delete first n elements, keeping the rest
  5. nth - get the element at given position
  6. appendAll - join two RRB Vectors together efficiently

Performance

RRB Vectors are able to keep up with or outperform their mutable Array counterparts on almost all operations save append. With a suitable Builder class or helper to convert from your favorite collection type, even this limitation can be mitigated

comparisons with other frameworks

|framework | ops per sec | type | |------------------------------------------|----------------:|:-----------:| |native push 1k immutable with es6 spread | 335.75 op/s | push/append | |immutable-js append 1k | 1815.33 op/s | push/append | |mori vector append 1k | 4395.11 op/s | push/append | |rrbit 1k | 3407.20 op/s | push/append | |rrbit 1k (Occulance enabled) | 8012.65 op/s | push/append | |rrbit 1k (Builder mode) | 19410.27 op/s | push/append | |rrbit 1k (Cassowry: Occulance enabled) | 22929.65 op/s | push/append | |rrbit 1k (Cassowry: Builder mode) | 69948.84 op/s | push/append | |native mutating push 1k(max possible) | 203927.41 op/s | push/append | |--------------------------------------------------------------------------| |mori iteration speed | 18052.66 op/s| for of loop | |immutable-js iteration speed | 18811.21 op/s| for of loop | |rrbit iteration speed | 33367.63 op/s| for of loop | |native array iteration speed | 17023.14 op/s| for of loop | |native forEach speed | 79403.02 op/s| forEach | |rrbit reduce | 63164.88 op/s| reduce | |lodash v4 forEach | 73609.82 op/s| forEach | |native for loop | 1203400.09 op/s| for | |rrbit cassowry reduce speed | 1751116.63 op/s| reduce | |--------------------------------------------------------------------------| |native push 1k immutable with es6 spread | 352.55 op/s| unshift/prepend | |immutable-js unshift 1k | 947.95 op/s| unshift/prepend | |mori prepend 1k | 2598.45 op/s| unshift/prepend | |native mutating unshift 1k | 8237.15 op/s| unshift/prepend | |rrbit (Cassowry: prepend) 1k | 17420.03 op/s| unshift/prepend | |--------------------------------------------------------------------------| |native slice half | 28064.72 op/s | take/slice | |rrbit take | 1361882.81 op/s | take/slice | |immutable-js take half | 2100578.67 op/s | take/slice | |mori take half | 2396771.15 op/s | take/slice | |rrbit (Cassowry) take | 3260573.92 op/s | take/slice |