中文文档 | English
rxlsb - High Performance XLSB Library for Rust
A pure Rust implementation for reading and writing Excel XLSB (Binary) files with exceptional performance.
Features
- High Performance: 200K rows/sec write, 2.3M rows/sec read, outperforming Java jxlsb
- Zero-copy: Bytes-based architecture minimizing memory copying
- Streaming API: Batch write, paginated read, stream processing
- Template Filling: Data filling based on existing templates
- Type Safe: Rust type system guarantees, no runtime errors
Performance Comparison
| Operation | rxlsb (Rust) | jxlsb (Java) | Improvement |
|---|---|---|---|
| Stream Write | 201K/s | 137K/s | +46% |
| Batch Write | 190K/s | 111K/s | +71% |
| Stream Read | 2.3M/s | 1.95M/s | +18% |
| Paginated Read | 31K/s | 10K/s | +210% |
Quick Start
Writing XLSB Files
use ;
use PathBuf;
let path = from;
let mut writer = builder.path.build.unwrap;
writer.write_batch.unwrap;
writer.close.unwrap;
Reading XLSB Files
use ;
use PathBuf;
let path = from;
let mut reader = builder.path.build.unwrap;
// Stream read
reader.for_each_row.unwrap;
// Paginated read
let rows = reader.read_rows.unwrap;
println!;
Installation
Add to your Cargo.toml:
[]
= "0.1"
API Overview
CellData Types
Write API
write_batch: Batch write entire sheet, suitable for small-medium datastart_sheet / write_rows / end_sheet: Stream write, suitable for large data
Read API
for_each_row: Stream read row by row, suitable for large dataread_rows: Paginated read batch data, suitable for pagination display
Architecture
- Layer 1: IO layer - BufferReader/BufferWriter (zero-copy Bytes)
- Layer 2: Container layer - ZIP container reader/writer
- Layer 3: Format layer - BIFF12 format serializer/deserializer
- Layer 4: API layer - XlsbReader/XlsbWriter/TemplateFiller
Project Status
- ✅ Core read/write functionality complete
- ✅ Template filling support
- ✅ All tests passing (9 tests)
- ✅ Performance optimized (outperforming Java jxlsb)
- ✅ API documentation complete
- 🚧 More cell types support (formula, rich text)
- 🚧 Chart support
Related Projects
License
MIT License
Contributing
Contributions welcome! Please read the contributing guidelines before submitting PRs.
Changelog
See CHANGELOG.md for version history.