FSharpx.DataStructures

GitHub repository of FSharpx.Core.DataStructures

Functional Data Structures in Typed Racket

FSharpx.DataStructures Performance Metrics

BootstrappedQueue


BootstrappedQueue Performance Metrics

Observations

Purely Functional

  1. Generally good create and populate (Init, new(), and AddOne Actions) performance up to scale 106.
  2. AddOne Action performance relative to Init shows marked slowdown at scale 105.

No constructor, but you can use the only type member NonEmptyBootstrappedQueue.create in a non-obvious way to quickly instantiate from a List.

Should be incorporated into an ofList member.

BootstrappedQueue Docs



DList

DList Performance Metrics
Observations

Purely Functional

  1. Init performance always better than AddOne, very noticeable starting at scale 104.

A Difference List, or DList, is an implementation of John Hughes’ append list. This implementation adds an additional parameter to allow a more efficient calculation of the list length.

Note that an alternate form would represent the DList as:
type DList<'a> = DList of ('a list -> 'a list)

DList Docs



ImplicitQueue

ImplicitQueue Performance Metrics
Observations

Purely Functional

  1. Good scaling performance of AddOne. No native Init or new() Action.


ImplicitQueue Docs

RealTimeQueue

RealTimeQueue Performance Metrics
Observations

Purely Functional

  1. Stack overflow at scale 105 in both 64 and 32-bit systems.
  2. Up to scale 104 AddOne scaling is close to O(1).
  3. No native Init or new() Action.


RealTimeQueue Docs

Vector

Persitent Vector Performance Metrics
Transient Vector Performance Metrics
Persitent Vector Observations

Purely Functional

  1. AddOne Action performance deteriorates at scale 104 or 105.
  2. Init Action (ofSeq) performance good through scale 105.


Transient Vector Observations

Not Purely Functional

  1. AddOne Action performance good through scale 106.

Ported from the Clojure implementation, a Vector is a collection of values indexed by contiguous integers implemented as an immutable hash array mapped trie.

Vector Docs

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>