Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vladar4/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).
https://github.com/vladar4/faststack
nim
Last synced: about 1 month ago
JSON representation
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).
- Host: GitHub
- URL: https://github.com/vladar4/faststack
- Owner: Vladar4
- License: other
- Created: 2016-08-14T20:42:02.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-19T14:38:24.000Z (over 8 years ago)
- Last Synced: 2024-11-10T04:07:48.498Z (3 months ago)
- Topics: nim
- Language: Nimrod
- Size: 33.2 KB
- Stars: 13
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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](https://github.com/ivankoster/nimbench))
**test** - Unit testing suite (using [unittest](http://nim-lang.org/docs/unittest.html))
Benchmark (int)
===============```nimrod
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](chart_bench_int.png "bench_int chart")
Benchmark (ptr)
===============```nimrod
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](chart_bench_ptr.png "bench_ptr_chart")