DEV Community

Nytrox
Nytrox

Posted on • Edited on

Veltix v1.6.2: Lighter protocol, better architecture, and Rust experiments ahead

Veltix v1.6.2: Lighter, Faster, and a Rust Experiment Coming

Hey Dev.to!

I'm Nytrox, a self-taught developer and the creator of Veltix, a pure Python TCP networking library with zero dependencies. Today I want to share what's coming in v1.6.2 and where the project is heading.

What changed in v1.6.2

Reworked socket abstraction layer

The biggest architectural change in this version is a complete rework of BaseSocket and ThreadingSocket. The new BaseSocket is a clean, minimal Protocol that exposes only what matters: bind, connect, send, close, and callbacks. All the threading logic now lives inside ThreadingSocket instead of leaking into Server and Client. This makes the codebase much easier to maintain and paves the way for a selectors-based backend in v1.7.0.

Lighter protocol header

The message header went from 62 bytes down to 22 bytes. I replaced SHA256 with CRC32 and dropped UUID4 in favor of a 4-byte random ID. On high throughput workloads this makes a real difference.

MessageBuffer optimization

The internal message buffer was reworked to eliminate unnecessary memory allocations on every received message. Less garbage collection pressure, better throughput.

What's next: experimenting with Rust

In the coming versions I'm planning to experiment with rewriting some performance-critical parts of Veltix in Rust via PyO3. This will be completely optional for users who don't want the compiled extension. Pure Python will always remain the default.

A project built on top of Veltix

I'm also working on a real-world project powered by Veltix to prove it's production-ready. More details soon.

Veltix is at 3,150+ downloads and growing. If you're curious, check it out on GitHub or PyPI!

GitHub: github.com/NytroxDev/veltix

Top comments (0)