Giter Club home page Giter Club logo

collections's Introduction

Certora Collections

Fast, memory-efficient immutable collections for Kotlin.

Motivation

Kotlin makes it quite easy and natural to manipulate immutable data structures. However, the standard library does not provide efficient implementations of immutable collections. kotlinx.collections.immutable provides a set of interfaces that are designed to be implemented by efficient immutable collections, along with a reference implementation. However, in developing the Certora Prover, we found that the reference implementation did not make the right performance tradeoffs for our use cases.

Most collection implementations, including the ones mentioned previously, are optimized primarily for speed of operations on single elements of the collection, e.g., adding an element to a Set, looking up a single value in a Map, getting a single List element by index. However, in many use cases the more performance-critical operations are those that operate over the whole data structure, such computing set unions or intersection of two sets, or merging two maps.

The Certora Collections library provides Set and Map and List implementations which are optimized primarily for such operations. Further, we optimize heavily for memory usage over speed of operations on single elements. We also provide some additional features that we have found useful in the Certora Prover, such as efficient parallel operations.

Usage


The Certora Collections library is available on JitPack.

API

The API builds on the interfaces provided by [kotlinx.collections.immutable]. See The Kotlin Immutable Collections proposal. We provide some additional methods beyond the PersistentMap, PersistentSet, and PersistentList interfaces provided by kotlinx.collections.immutable, in the TreapMap, TreapSet, and TreapList interfaces.

To create instances of these collections, use the functions treapMapOf, treapSetOf, and treapListOf.

collections's People

Contributors

ericeil avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ericeil

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.