kprotty/zap

An asynchronous runtime with a focus on performance and resource efficiency.

552

stars

73

commits

Zig

primary language

Jan 2, 2025

updated

github.com/kprotty/zap
asynchronous
io
networking
performance
runtime
rust
scheduler
unix
windows
zig

README

zap License

Designing efficient task scheduling for Ziglang.

Goals

So I originally started this project around 2019 in order to develop memory, threads, io, and synchronization primitives for Zig given they were lacking at the time. Over the months, it shifted more on developing a runtime (or thread pool rather) that was both resource efficient (one of Zig's, and my personal, implicit Zen's) and competitive in performance with existing implementations.

Here lies the result of that effort for now. There's still more experimenting to do like how to dispatch I/O efficiently and the like, but I'm happy with what has come and wanted to share. You can find a copy of the blogpost in this repo, the reference implementation in src, and some of my previous attempts in their own branch.

Benchmarks

To benchmark the implementation, I wrote some quicksort implementations for similar APIs in other languages. The reasoning behind quicksort is that it's fairly practical and can also be heavy with concurrency. Try running them locally!

Contributors

kprotty

69 commits

Arnavion

1 commits

delaneyj

1 commits

fogti

1 commits

kprotty/zap

An asynchronous runtime with a focus on performance and resource efficiency.

552

stars

73

commits

Zig

primary language

Jan 2, 2025

updated

github.com/kprotty/zap
asynchronous
io
networking
performance
runtime
rust
scheduler
unix
windows
zig

README

zap License

Designing efficient task scheduling for Ziglang.

Goals

So I originally started this project around 2019 in order to develop memory, threads, io, and synchronization primitives for Zig given they were lacking at the time. Over the months, it shifted more on developing a runtime (or thread pool rather) that was both resource efficient (one of Zig's, and my personal, implicit Zen's) and competitive in performance with existing implementations.

Here lies the result of that effort for now. There's still more experimenting to do like how to dispatch I/O efficiently and the like, but I'm happy with what has come and wanted to share. You can find a copy of the blogpost in this repo, the reference implementation in src, and some of my previous attempts in their own branch.

Benchmarks

To benchmark the implementation, I wrote some quicksort implementations for similar APIs in other languages. The reasoning behind quicksort is that it's fairly practical and can also be heavy with concurrency. Try running them locally!

Contributors

kprotty

69 commits

Arnavion

1 commits

delaneyj

1 commits

fogti

1 commits

Languages

Zig

93.6%

Rust

4.6%

Go

1.8%