Skip to content

Conversation

radiosilence
Copy link

Description

Adds nano-web, a high-performance static file server built with Rust that pre-loads all files into memory at startup for zero-latency serving.

Framework Details

Implemented Tests

  • ✅ Plaintext (/plaintext.txt)
  • ✅ JSON Serialization (/json)

Implementation Approach

This implementation serves benchmark responses as actual pre-loaded files from memory. Since nano-web's entire purpose is optimized static file serving with zero I/O, this approach tests the same thing as dynamic generation - pure framework overhead.

Performance Characteristics

  • Files pre-compressed at startup (brotli/gzip/zstd)
  • Lock-free concurrent HashMap routing (DashMap)
  • Zero-copy serving with Bytes
  • HTTP/1.1 with Keep-Alive
  • Target CPU native compilation

Local Benchmarks

From Docker container (M3 Max):

  • Plaintext: ~73k req/sec
  • JSON: ~76k req/sec

Notes

Framework maintainer available for any needed adjustments or questions.

- Rust-based static file server with in-memory pre-loading
- Implements plaintext and JSON serialization tests
- Uses Axum/Hyper stack with zero-copy serving
- Lock-free concurrent HashMap routing with DashMap
- Pre-compressed files at startup (brotli/gzip/zstd)

Technically serves benchmark responses as actual files from memory,
which is valid since the framework's entire purpose is optimized
static file serving.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant