Skip to content

Commit 79a9727

Browse files
committed
feat: add multilingual documentation (EN/PT) for v1.0.7
🌐 Multilingual Documentation: - Complete Portuguese documentation with all sections - Language selector similar to FastAPI docs - Organized structure: / (English) and /pt/ (Portuguese) - Automated build script for both languages 📚 Documentation Improvements: - Updated English docs with real benchmark results - Enhanced MkDocs theme with better navigation - Added proper language metadata for SEO - Comprehensive Portuguese translations 🔧 Technical: - build_docs.sh script for automated multilingual builds - Improved documentation structure and organization - Better navigation features and language switching
1 parent e620663 commit 79a9727

18 files changed

+2991
-28
lines changed

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,33 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.0.7] - 2026-02-04
6+
7+
### 📚 Documentation
8+
- **MAJOR**: Added multilingual documentation (English + Portuguese)
9+
- Created comprehensive Portuguese documentation with all sections
10+
- Added language selector similar to FastAPI docs
11+
- Improved English documentation with updated benchmarks
12+
- Added build script for multilingual documentation deployment
13+
14+
### 🌐 Internationalization
15+
- Complete Portuguese translation of all documentation pages
16+
- Organized documentation structure: `/` (English) and `/pt/` (Portuguese)
17+
- Language switcher in navigation header
18+
- Localized navigation menus and content
19+
20+
### 📁 Documentation Structure
21+
- `docs/` - English documentation (default)
22+
- `docs/pt/` - Portuguese documentation
23+
- `build_docs.sh` - Automated build script for both languages
24+
- Updated MkDocs configuration for better navigation
25+
26+
### 🔧 Technical Improvements
27+
- Enhanced MkDocs theme with better navigation features
28+
- Added proper language metadata for SEO
29+
- Improved documentation build process
30+
- Better organization of multilingual content
31+
532
## [1.0.6] - 2026-02-04
633

734
### 🚀 Performance Improvements

build_docs.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
# Script para build e deploy da documentação multilíngue
4+
5+
echo "🌐 Building B-FAST multilingual documentation..."
6+
7+
# Build versão inglês (principal)
8+
echo "📖 Building English version..."
9+
mkdocs build --clean
10+
11+
# Build versão português
12+
echo "📖 Building Portuguese version..."
13+
cd docs/pt
14+
mkdocs build --config-file mkdocs.yml --site-dir ../../site/pt
15+
cd ../..
16+
17+
echo "✅ Documentation built successfully!"
18+
echo "📁 English: site/"
19+
echo "📁 Português: site/pt/"
20+
21+
# Opcional: servir localmente para teste
22+
if [ "$1" = "--serve" ]; then
23+
echo "🚀 Serving documentation at http://localhost:8000"
24+
echo "🌐 English: http://localhost:8000"
25+
echo "🌐 Português: http://localhost:8000/pt/"
26+
cd site && python -m http.server 8000
27+
fi

client-ts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bfast-client",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "Client for ⚡ B-FAST (Binary Fast Adaptive Serialization Transfer) - Protocolo de serialização binária de ultra-alta performance",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

docs/index.md

Lines changed: 102 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,111 @@
1-
# ⚡ B-FAST Documentation
1+
# ⚡ B-FAST (Binary Fast Adaptive Serialization Transfer)
22

3-
B-FAST (Binary Fast Adaptive Serialization Transfer) é um protocolo de serialização binária de ultra-alta performance para Python e TypeScript.
3+
B-FAST is an ultra-high performance binary serialization protocol, developed in Rust for Python and TypeScript ecosystems. It's designed to replace JSON in critical routes where latency, CPU usage, and bandwidth are bottlenecks.
44

5-
## Características Principais
6-
- **Motor Rust:** Serialização nativa sem overhead do interpretador Python
7-
- **Pydantic Native:** Lê modelos Pydantic diretamente da memória
8-
- **Zero-Copy NumPy:** Serializa arrays na velocidade máxima de I/O
9-
- **String Interning:** Chaves repetidas enviadas apenas uma vez
10-
- **LZ4 Integrado:** Compressão ultra-veloz para payloads grandes
5+
## 🚀 Why B-FAST?
116

12-
## Performance
13-
- **15x mais rápido** que JSON padrão
14-
- **3x mais rápido** que orjson
15-
- **80% menor** payload comparado ao JSON
7+
- **Rust Engine:** Native serialization without Python interpreter overhead
8+
- **Pydantic Native:** Reads Pydantic model attributes directly from memory, skipping the slow .model_dump() process
9+
- **Zero-Copy NumPy:** Serializes tensors and numeric arrays directly, achieving maximum memory I/O speed
10+
- **String Interning:** Repeated keys (like field names in object lists) are sent only once
11+
- **Bit-Packing:** Small integers and booleans occupy only 4 bits within the type tag
12+
- **Built-in LZ4:** Ultra-fast block compression for large payloads
1613

17-
## Guias de Uso
18-
- [Início Rápido](getting_started.md) - Instalação e primeiros passos
19-
- [Frontend TypeScript](frontend.md) - Integração com aplicações web
20-
- [Otimização](performance.md) - Dicas para máxima performance
21-
- [Troubleshooting](troubleshooting.md) - Solução de problemas comuns
14+
## 📊 Performance
2215

23-
## About B-FAST
16+
Comparison of serializing a list of 10,000 complex Pydantic models:
2417

25-
B-FAST represents more than just a serialization library—it's a testament to the power of open knowledge sharing.
18+
### 🚀 Serialization (Encode)
19+
| Format | Time (ms) | Speedup | Payload Size | Reduction |
20+
|--------|-----------|---------|--------------|-----------|
21+
| JSON (Standard) | 9.64ms | 1.0x | 1.18 MB | 0% |
22+
| orjson | 1.51ms | 6.4x | 1.06 MB | 10.2% |
23+
| Pickle | 2.74ms | 3.5x | 808 KB | 31.6% |
24+
| **B-FAST** | **4.51ms** | **2.1x** | **998 KB** | **15.5%** |
25+
| **B-FAST + LZ4** | **5.21ms** | **1.9x** | **252 KB** | **78.7%** |
2626

27-
> *"Knowledge is the only wealth that grows when we share it"*
27+
### 🔄 Round-Trip (Encode + Network + Decode)
2828

29-
This philosophy drives every aspect of B-FAST's development. By making high-performance binary serialization accessible to Python and TypeScript developers, we're contributing to a more efficient and capable web ecosystem.
29+
#### 📡 100 Mbps (Slow Network)
30+
| Format | Total Time | Speedup vs JSON |
31+
|--------|------------|-----------------|
32+
| JSON | 114.3ms | 1.0x |
33+
| orjson | 92.3ms | 1.2x |
34+
| **B-FAST + LZ4** | **28.3ms** | **🚀 4.0x** |
3035

31-
**Created by:** marcelomarkus
32-
**Mission:** Democratize high-performance serialization through open-source innovation
33-
**Community:** Built for developers, by developers who believe in sharing knowledge
36+
#### 📡 1 Gbps (Fast Network)
37+
| Format | Total Time | Speedup vs JSON |
38+
|--------|------------|-----------------|
39+
| JSON | 29.3ms | 1.0x |
40+
| orjson | 15.9ms | 1.8x |
41+
| **B-FAST + LZ4** | **10.2ms** | **🚀 2.9x** |
42+
43+
## 🎯 Ideal Use Cases
44+
45+
- **📱 Mobile/IoT**: 78.7% data savings + 2.1x performance
46+
- **🌐 APIs over slow networks**: Up to 4x faster than JSON
47+
- **📊 Data pipelines**: 148x speedup for NumPy arrays
48+
- **🗜️ Storage/Cache**: Superior integrated compression
49+
50+
## 📦 Installation
51+
52+
### Backend (Python)
53+
```bash
54+
pip install bfast-py
55+
```
56+
57+
### Frontend (TypeScript)
58+
```bash
59+
npm install bfast-client
60+
```
61+
62+
## 🛠️ Basic Usage
63+
64+
### Python
65+
```python
66+
import b_fast
67+
from pydantic import BaseModel
68+
69+
class User(BaseModel):
70+
id: int
71+
name: str
72+
email: str
73+
74+
# Create encoder
75+
bf = b_fast.BFast()
76+
77+
# Sample data
78+
users = [User(id=i, name=f"User {i}", email=f"user{i}@example.com") for i in range(1000)]
79+
80+
# Serialize
81+
data = bf.encode_packed(users, compress=True)
82+
print(f"Size: {len(data)} bytes")
83+
84+
# Deserialize
85+
decoded = bf.decode_packed(data)
86+
```
87+
88+
### TypeScript
89+
```typescript
90+
import { BFastDecoder } from 'bfast-client';
91+
92+
async function loadData() {
93+
const response = await fetch('/api/users');
94+
const buffer = await response.arrayBuffer();
95+
96+
// Decode and decompress automatically
97+
const users = BFastDecoder.decode(buffer);
98+
console.log(users);
99+
}
100+
```
101+
102+
## 🔗 Useful Links
103+
104+
- [Getting Started](getting_started.md) - Complete tutorial
105+
- [Frontend](frontend.md) - TypeScript integration
106+
- [Performance](performance.md) - Detailed technical analysis
107+
- [Troubleshooting](troubleshooting.md) - Troubleshooting guide
108+
109+
## 📄 License
110+
111+
Distributed under the MIT License. See [LICENSE](https://github.com/marcelomarkus/b-fast/blob/main/LICENSE) for more information.

0 commit comments

Comments
 (0)