No description
Find a file
2016-08-19 17:38:11 +03:00
doc added documentation 2016-08-15 00:15:34 +03:00
tools updated test.nim 2016-08-19 17:38:11 +03:00
chart_bench_int.png added readme 2016-08-15 00:15:54 +03:00
chart_bench_ptr.png added readme 2016-08-15 00:15:54 +03:00
faststack.nim initial commit 2016-08-15 00:14:47 +03:00
faststack.nimble updated nimble file 2016-08-17 09:48:35 +03:00
LICENSE added license 2016-08-15 00:15:16 +03:00
README.md added nimble file 2016-08-15 00:24:40 +03:00

FastStack

FastStack is dynamically resizable data structure optimized for fast iteration over the large arrays of similar elements avoiding memory fragmentation (e.g., update and rendering cycles of a game scene).

Tools

bench_int - Benchmark with int elements (low memory fragmentation case)

bench_ptr - Benchmark with ptr elements (high memory fragmentation case)

(using nimbench)

test - Unit testing suite (using unittest)

Benchmark (int)

type
  Elem = ref object of RootObj
    data: int

Comparing to seq and DoublyLinkedList on i5-2500K @ 4000MHz:

============================================================================
GlobalBenchmark                                 relative  time/iter  iters/s
============================================================================
GlobalBenchmark                                            249.31ps    4.01G
============================================================================
bench_int.nim                                   relative  time/iter  iters/s
============================================================================
Sequence                                                   108.55us    9.21K
List                                                       545.62us    1.83K
FastStack                                                  115.65us    8.65K
  • Seq: 100.00%
  • List: 19.87%
  • FastStack: 93.92%

chart_bench_int

Benchmark (ptr)

type
  Elem = ref object of RootObj
    data: pointer

Comparing to seq and DoublyLinkedList on i5-2500K @ 4000MHz:

============================================================================
GlobalBenchmark                                 relative  time/iter  iters/s
============================================================================
GlobalBenchmark                                            249.31ps    4.01G
============================================================================
bench_ptr.nim                                   relative  time/iter  iters/s
============================================================================
Sequence                                                     1.65ms   607.54
List                                                         2.21ms   452.28
FastStack                                                    1.38ms   724.24
  • Seq: 100.00%
  • List: 74.44%
  • FastStack: 119.21%

chart_bench_ptr