detached 111649b

docs: Update README for clarity and structure

- Refine project description to emphasize foundational role of WLTurbo
- Reorganize sections for better flow: Overview, Features, Design Goals, Implementation Status
- Enhance performance targets and optimizations details
- Update usage example in Quick Start section
- Clarify contribution areas and remove outdated information
commit
111649b1f3def6ff216191aa04d00eecbe14b435
author
bamen · · 2025-06-20 05:54 UTC
parent
4a0dffe
signature
unsigned
1 file · +56 -53
M README.md +56 -53
@@ -1,33 +1,39 @@
1-# WLTurbo - High-Performance Wayland Client for Go
1+# WLTurbo - Wayland Client Library for Go
22
3-🚀 **Ultra-fast, zero-allocation Wayland client library optimized for gaming and real-time applications**
3+A performance-focused Wayland client library that provides the foundational protocol implementation for building Wayland applications and libraries.
44
5-## Features
5+## Overview
6+
7+WLTurbo is a low-level Wayland client library that handles core protocol communication. It serves as the base layer for higher-level libraries like [libwldevices-go](https://github.com/bnema/libwldevices-go) which implement specific Wayland protocol extensions.
8+
9+## Architecture
10+
11+WLTurbo provides the foundational Wayland client infrastructure:
12+
13+- **Core Protocol Objects**: Display, Registry, Compositor, Surface, Seat, Region
14+- **Event Dispatching**: Efficient routing of Wayland events to handlers
15+- **Connection Management**: Unix socket communication with the compositor
16+- **Memory Management**: Shared memory support via file descriptor passing
17+
18+Higher-level protocol implementations (virtual input devices, output management, etc.) are intentionally left to specialized libraries that build on top of WLTurbo.
619
7-- **🎯 Sub-microsecond latency** - < 500ns input event processing
8-- **⚡ Zero-allocation hot paths** - No GC pressure during event handling
9-- **🎮 Gaming optimized** - 360-500+ FPS support, 8000Hz device compatibility
10-- **🔒 Lock-free architecture** - MPSC queues and atomic operations
11-- **🏎️ SIMD optimizations** - Vectorized batch operations
12-- **📊 Cache-friendly** - 64-byte aligned data structures
13-- **🔧 Go 1.24 ready** - Leverages latest performance features
20+## Features
1421
15-## Performance Targets
22+### Performance Optimizations
1623
17-| Metric | Target | Description |
18-|--------|--------|-------------|
19-| **Input Latency** | < 125μs | Input-to-dispatch (8000Hz polling rate) |
20-| **Event Dispatch** | < 50ns | Per-event processing time |
21-| **Allocations** | 0 | Zero allocations in steady state |
22-| **GC Pause** | < 10μs | Maximum garbage collection pause |
23-| **Throughput** | 16,000+ | Events per second capacity |
24+- **Zero-allocation event handling**: For messages under 4KB
25+- **Lock-free dispatcher**: For object IDs < 1024 using atomic operations
26+- **Pre-allocated buffers**: Reusable buffers to minimize allocations
27+- **Direct array indexing**: Fast opcode lookup for common cases
28+- **Buffer pooling**: sync.Pool for temporary allocations
29+- **File descriptor passing**: Efficient shared memory via SCM_RIGHTS
2430
25-## Gaming Hardware Support
31+### Design Goals
2632
27-- **8000Hz Mice**: Razer Viper 8K, Corsair Sabre RGB Pro
28-- **8000Hz Keyboards**: Wooting 80HE with true analog scanning
29-- **High-refresh displays**: ASUS ROG Swift 500Hz, BenQ Zowie XL2566K
30-- **VRR/G-Sync**: Variable refresh rate awareness
33+- Minimal allocations in hot paths
34+- Efficient event dispatching
35+- Clean API for protocol extensions
36+- Foundation for high-performance Wayland applications
3137
3238 ## Quick Start
3339
@@ -35,18 +41,18 @@
3541 package main
3642
3743 import (
38- "github.com/bnema/wlturbo"
44+ "github.com/bnema/wlturbo/wl"
3945 )
4046
4147 func main() {
4248 // Connect to Wayland display
43- display, err := wlturbo.Connect("")
49+ display, err := wl.Connect("")
4450 if err != nil {
4551 panic(err)
4652 }
4753 defer display.Close()
4854
49- // Ultra-low latency event loop
55+ // Basic event loop
5056 for {
5157 if err := display.Dispatch(); err != nil {
5258 break
@@ -55,33 +61,32 @@ func main() {
5561 }
5662 ```
5763
58-## Architecture
64+For device control and input injection, use [libwldevices-go](https://github.com/bnema/libwldevices-go) which builds on top of WLTurbo.
5965
60-WLTurbo is built with gaming performance in mind:
66+## Implementation Status
6167
62-- **Lock-free Event Queue**: MPSC ring buffer for zero-contention event handling
63-- **Object Pool**: Pre-allocated event objects to eliminate malloc overhead
64-- **Direct Dispatch**: Array-based handler lookup for objects < 1024
65-- **Batch Processing**: Process multiple events per syscall
66-- **Memory Pool**: Size-classed allocators for temporary buffers
68+### Core Protocol ✅
69+- Display, Registry, Compositor, Surface, Seat, Region
70+- Event dispatching and handler registration
71+- File descriptor passing for shared memory
72+- Context-based proxy management
6773
68-## Benchmarks
74+### Optimizations ✅
75+- Zero-allocation event handling (messages < 4KB)
76+- Lock-free dispatcher for common cases
77+- Pre-allocated and pooled buffers
78+- Efficient event routing
6979
70-```
71-BenchmarkEventDispatch-16 20000000 50.2 ns/op 0 B/op 0 allocs/op
72-BenchmarkMessageSend-16 40000000 25.1 ns/op 0 B/op 0 allocs/op
73-BenchmarkFDPassing-16 5000000 200.0 ns/op 0 B/op 0 allocs/op
74-```
80+### Future Improvements
81+- Performance benchmarks and validation
82+- Additional optimizations based on profiling
83+- Extended protocol object support as needed
7584
7685 ## Requirements
7786
78-- **Go 1.24+** (for latest performance features)
79-- **Linux** (Wayland compositor required)
80-- **Modern CPU** (for SIMD optimizations)
81-
82-## Status
83-
84-🚧 **Active Development** - Core functionality complete, optimizations ongoing
87+- **Go 1.21+**
88+- **Linux** with Wayland compositor
89+- **Unix sockets** support
8590
8691 ## License
8792
@@ -89,10 +94,8 @@ MIT License - see LICENSE file for details
8994
9095 ## Contributing
9196
92-PRs welcome! Please read CONTRIBUTING.md for guidelines.
93-
94-Focus areas:
95-- Performance optimizations
96-- Gaming-specific features
97-- Protocol extension support
98-- Benchmark improvements⏎̸
97+Contributions welcome! Areas of focus:
98+- Performance improvements
99+- Additional protocol object support
100+- Documentation and examples
101+- Benchmark suite⏎̸
@@ -1,33 +1,39 @@
1-# WLTurbo - High-Performance Wayland Client for Go1+# WLTurbo - Wayland Client Library for Go
2 2
3-🚀 **Ultra-fast, zero-allocation Wayland client library optimized for gaming and real-time applications**3+A performance-focused Wayland client library that provides the foundational protocol implementation for building Wayland applications and libraries.
4 4
5-## Features5+## Overview
6+
7+WLTurbo is a low-level Wayland client library that handles core protocol communication. It serves as the base layer for higher-level libraries like [libwldevices-go](https://github.com/bnema/libwldevices-go) which implement specific Wayland protocol extensions.
8+
9+## Architecture
10+
11+WLTurbo provides the foundational Wayland client infrastructure:
12+
13+- **Core Protocol Objects**: Display, Registry, Compositor, Surface, Seat, Region
14+- **Event Dispatching**: Efficient routing of Wayland events to handlers
15+- **Connection Management**: Unix socket communication with the compositor
16+- **Memory Management**: Shared memory support via file descriptor passing
17+
18+Higher-level protocol implementations (virtual input devices, output management, etc.) are intentionally left to specialized libraries that build on top of WLTurbo.
6 19
7-- **🎯 Sub-microsecond latency** - < 500ns input event processing20+## Features
8-- **⚡ Zero-allocation hot paths** - No GC pressure during event handling
9-- **🎮 Gaming optimized** - 360-500+ FPS support, 8000Hz device compatibility
10-- **🔒 Lock-free architecture** - MPSC queues and atomic operations
11-- **🏎️ SIMD optimizations** - Vectorized batch operations
12-- **📊 Cache-friendly** - 64-byte aligned data structures
13-- **🔧 Go 1.24 ready** - Leverages latest performance features
14 21
15-## Performance Targets22+### Performance Optimizations
16 23
17-| Metric | Target | Description |24+- **Zero-allocation event handling**: For messages under 4KB
18-|--------|--------|-------------|25+- **Lock-free dispatcher**: For object IDs < 1024 using atomic operations
19-| **Input Latency** | < 125μs | Input-to-dispatch (8000Hz polling rate) |26+- **Pre-allocated buffers**: Reusable buffers to minimize allocations
20-| **Event Dispatch** | < 50ns | Per-event processing time |27+- **Direct array indexing**: Fast opcode lookup for common cases
21-| **Allocations** | 0 | Zero allocations in steady state |28+- **Buffer pooling**: sync.Pool for temporary allocations
22-| **GC Pause** | < 10μs | Maximum garbage collection pause |29+- **File descriptor passing**: Efficient shared memory via SCM_RIGHTS
23-| **Throughput** | 16,000+ | Events per second capacity |
24 30
25-## Gaming Hardware Support31+### Design Goals
26 32
27-- **8000Hz Mice**: Razer Viper 8K, Corsair Sabre RGB Pro33+- Minimal allocations in hot paths
28-- **8000Hz Keyboards**: Wooting 80HE with true analog scanning34+- Efficient event dispatching
29-- **High-refresh displays**: ASUS ROG Swift 500Hz, BenQ Zowie XL2566K35+- Clean API for protocol extensions
30-- **VRR/G-Sync**: Variable refresh rate awareness36+- Foundation for high-performance Wayland applications
31 37
32 ## Quick Start38 ## Quick Start
33 39
@@ -35,18 +41,18 @@
35 package main41 package main
36 42
37 import (43 import (
38- "github.com/bnema/wlturbo"44+ "github.com/bnema/wlturbo/wl"
39 )45 )
40 46
41 func main() {47 func main() {
42 // Connect to Wayland display48 // Connect to Wayland display
43- display, err := wlturbo.Connect("")49+ display, err := wl.Connect("")
44 if err != nil {50 if err != nil {
45 panic(err)51 panic(err)
46 }52 }
47 defer display.Close()53 defer display.Close()
48 54
49- // Ultra-low latency event loop55+ // Basic event loop
50 for {56 for {
51 if err := display.Dispatch(); err != nil {57 if err := display.Dispatch(); err != nil {
52 break58 break
@@ -55,33 +61,32 @@ func main() {
55 }61 }
56 ```62 ```
57 63
58-## Architecture64+For device control and input injection, use [libwldevices-go](https://github.com/bnema/libwldevices-go) which builds on top of WLTurbo.
59 65
60-WLTurbo is built with gaming performance in mind:66+## Implementation Status
61 67
62-- **Lock-free Event Queue**: MPSC ring buffer for zero-contention event handling68+### Core Protocol ✅
63-- **Object Pool**: Pre-allocated event objects to eliminate malloc overhead69+- Display, Registry, Compositor, Surface, Seat, Region
64-- **Direct Dispatch**: Array-based handler lookup for objects < 102470+- Event dispatching and handler registration
65-- **Batch Processing**: Process multiple events per syscall71+- File descriptor passing for shared memory
66-- **Memory Pool**: Size-classed allocators for temporary buffers72+- Context-based proxy management
67 73
68-## Benchmarks74+### Optimizations ✅
75+- Zero-allocation event handling (messages < 4KB)
76+- Lock-free dispatcher for common cases
77+- Pre-allocated and pooled buffers
78+- Efficient event routing
69 79
70-```80+### Future Improvements
71-BenchmarkEventDispatch-16 20000000 50.2 ns/op 0 B/op 0 allocs/op81+- Performance benchmarks and validation
72-BenchmarkMessageSend-16 40000000 25.1 ns/op 0 B/op 0 allocs/op82+- Additional optimizations based on profiling
73-BenchmarkFDPassing-16 5000000 200.0 ns/op 0 B/op 0 allocs/op83+- Extended protocol object support as needed
74-```
75 84
76 ## Requirements85 ## Requirements
77 86
78-- **Go 1.24+** (for latest performance features)87+- **Go 1.21+**
79-- **Linux** (Wayland compositor required)88+- **Linux** with Wayland compositor
80-- **Modern CPU** (for SIMD optimizations)89+- **Unix sockets** support
81-
82-## Status
83-
84-🚧 **Active Development** - Core functionality complete, optimizations ongoing
85 90
86 ## License91 ## License
87 92
@@ -89,10 +94,8 @@ MIT License - see LICENSE file for details
89 94
90 ## Contributing95 ## Contributing
91 96
92-PRs welcome! Please read CONTRIBUTING.md for guidelines.97+Contributions welcome! Areas of focus:
93-98+- Performance improvements
94-Focus areas:99+- Additional protocol object support
95-- Performance optimizations100+- Documentation and examples
96-- Gaming-specific features101+- Benchmark suite⏎̸
97-- Protocol extension support
98-- Benchmark improvements⏎̸

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 8

↑↓ moveenter openesc close