项目作者: Robbepop

项目描述 :
An addressable pairing heap implementation for Rust.
高级语言: Rust
项目地址: git://github.com/Robbepop/addressable-pairing-heap.git
创建时间: 2017-02-25T14:32:58Z
项目社区:https://github.com/Robbepop/addressable-pairing-heap

开源协议:MIT License

下载


MIT licensed
Crates.io Version

Addressable Pairing-Heap

An addressable pairing heap implementation for Rust.

Allows to efficiently store elements associated with a key and access them via handles.
Handles to elements make it possible to query and edit elements stored in the PairingHeap.

Documentation: link
crates.io: link

Benchmarks show that the current implementation suffers from performance issues that have yet to be fixed:

Binary Heap (standard-lib)

  1. test binary_heap_clone ... bench: 27,537 ns/iter (+/- 1,006)
  2. test binary_heap_pop ... bench: 3,312,799 ns/iter (+/- 63,197)
  3. test binary_heap_pop_bigpod ... bench: 80,815,870 ns/iter (+/- 234,285)
  4. test binary_heap_push ... bench: 1,878,911 ns/iter (+/- 105,333)
  5. test binary_heap_push_bigpod ... bench: 43,423,423 ns/iter (+/- 283,598)

Pairing Heap (offset-based implementation)

  1. test ptr_pairing_heap_clone ... bench: 1,554,327 ns/iter (+/- 143,369)
  2. test ptr_pairing_heap_pop ... bench: 16,134,333 ns/iter (+/- 1,517,587)
  3. test ptr_pairing_heap_pop_bigpod ... bench: 48,197,309 ns/iter (+/- 157,727)
  4. test ptr_pairing_heap_push ... bench: 4,726,005 ns/iter (+/- 101,163)
  5. test ptr_pairing_heap_push_bigpod ... bench: 39,347,464 ns/iter (+/- 446,011)

Pairing Heap (vec-based implementation)

  1. test vec_pairing_heap_clone ... bench: 1,868,083 ns/iter (+/- 75,156)
  2. test vec_pairing_heap_pop ... bench: 11,877,821 ns/iter (+/- 637,347)
  3. test vec_pairing_heap_pop_bigpod ... bench: 58,990,571 ns/iter (+/- 370,100)
  4. test vec_pairing_heap_push ... bench: 2,960,636 ns/iter (+/- 117,900)
  5. test vec_pairing_heap_push_bigpod ... bench: 26,025,722 ns/iter (+/- 57,091)