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).
Install / Use
/learn @Vladar4/FastStackREADME
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%

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%

Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
