uringmachine 0.25.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/TODO.md +15 -5
- data/docs/wroclove.rb.md +52 -0
- data/ext/um/um.c +382 -364
- data/ext/um/um.h +41 -21
- data/ext/um/um_async_op.c +9 -8
- data/ext/um/um_async_op_class.c +3 -3
- data/ext/um/um_op.c +15 -1
- data/ext/um/um_ssl.c +1 -1
- data/ext/um/um_sync.c +18 -11
- data/ext/um/um_utils.c +14 -4
- data/lib/uringmachine/version.rb +1 -1
- data/test/test_async_op.rb +3 -2
- data/test/test_fiber_scheduler.rb +4 -1
- data/test/test_um.rb +289 -9
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ba017ea6da0eb880e2366157a7f1ff6ea936d32816ed2be45e3b3ca96b3c7408
|
|
4
|
+
data.tar.gz: 22f556023080078623fd8618122fe6707fa4cfdf6654b6c43e122f524c91c645
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c08b772dd22791c297fc38dab3e8a73453ace1b54ee5c9e7b31ef127598987efd37fdfebf009b9202d3b550674006caf380a0e20fb50e4c2a3bee7e302afa97b
|
|
7
|
+
data.tar.gz: 1f35f727b26808a0bca4c24c19ee41ef4400766ec1b3b7033dbd39fea635168f93757825c4bf9e38d065c66652cd5120ce1880f8ef484233abdaa8bd9dff3b84
|
data/CHANGELOG.md
CHANGED
data/TODO.md
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
## immediate
|
|
2
2
|
|
|
3
|
-
- Fix all futex value (Queue, Mutex) to be aligned
|
|
3
|
+
- Fix all futex value (Queue, Mutex) to be properly aligned
|
|
4
4
|
|
|
5
5
|
## Buffer rings - automatic management
|
|
6
6
|
|
|
7
|
+
- Take the buffer_pool branch, rewrite it
|
|
8
|
+
- Allow multiple stream modes:
|
|
9
|
+
- :buffer_pool - uses buffer rings
|
|
10
|
+
- :ssl - read from an SSL connection (`SSLSocket`)
|
|
11
|
+
- :io - read from an `IO`
|
|
12
|
+
|
|
13
|
+
The API will look something like:
|
|
14
|
+
|
|
7
15
|
```ruby
|
|
8
|
-
#
|
|
9
|
-
|
|
16
|
+
# The mode is selected automatically according to the given target
|
|
17
|
+
|
|
18
|
+
stream = UM::Stream.new(fd) # buffer_pool mode
|
|
19
|
+
|
|
20
|
+
stream = UM::Stream.new(ssl_sock) # ssl mode
|
|
10
21
|
|
|
11
|
-
|
|
12
|
-
machine.read_each(fd, io_buffer: true) { |iobuff, len| ... }
|
|
22
|
+
stream = UM::Stream.new(conn) # io mode
|
|
13
23
|
```
|
|
14
24
|
|
|
15
25
|
## Balancing I/O with the runqueue
|
data/docs/wroclove.rb.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# UringMachine - High Performance Concurrency for Ruby Using io_uring
|
|
2
|
+
|
|
3
|
+
https://www.papercall.io/talks/413880/children/413881
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
- Introduction: the name (1)
|
|
8
|
+
- What is io_uring (2)
|
|
9
|
+
- How UringMachine works (4)
|
|
10
|
+
- The liburing API
|
|
11
|
+
- Submitting an operation
|
|
12
|
+
- Fiber switching and the runqueue
|
|
13
|
+
- Waiting for and processing CQEs
|
|
14
|
+
- The UringMachine model:
|
|
15
|
+
- exhaust all CPU-bound work, submit I/O work to kernel
|
|
16
|
+
- Wait for and process completions
|
|
17
|
+
- repeat
|
|
18
|
+
- The UringMachine API (7)
|
|
19
|
+
- More or less equivalent to the Unix I/O API
|
|
20
|
+
- Synchronization: `UM::Mutex`, `UM::Queue`
|
|
21
|
+
- Useful abstractions for multishot operations
|
|
22
|
+
- OpenSSL support
|
|
23
|
+
- Custom BIO
|
|
24
|
+
- Streams / Automatic buffer management
|
|
25
|
+
- Utilities and advanced usage: `.inotify`, `.pipe`, `#splice`
|
|
26
|
+
- Timeouts and cancellations (4)
|
|
27
|
+
- Timeout - the basic design
|
|
28
|
+
- The challenges of cancellation
|
|
29
|
+
- double life cycle
|
|
30
|
+
- holding on to buffers
|
|
31
|
+
- ensuring the lifetime of relevant objects when doing an async operation.
|
|
32
|
+
- the TRANSIENT list of ops, for async operations (e.g. `#write_async` -
|
|
33
|
+
how to do we hold on to the write buffer.)
|
|
34
|
+
- how in general we mark the objects involved in async
|
|
35
|
+
- Integration with the Ruby ecosystem (6)
|
|
36
|
+
- The Fiber::Scheduler interface: the good, the bad and the ugly
|
|
37
|
+
- Dealing with CPU-bound workloads
|
|
38
|
+
- SQLite and Extralite in particular (`on_progress` handler)
|
|
39
|
+
- Performance (3)
|
|
40
|
+
- Benchmarks
|
|
41
|
+
- CPU-bound / IO-bound: how UringMachine deals with mixed workloads
|
|
42
|
+
- Applications (3)
|
|
43
|
+
- TP2 / Syntropy
|
|
44
|
+
- Uma - Rack-compatible app server
|
|
45
|
+
- Compare performance of a Rails app on Uma / Falcon / Puma
|
|
46
|
+
- Future directions (3)
|
|
47
|
+
- Further contributions to Ruby:
|
|
48
|
+
- Support for Socket I/O in Fiber::Scheduler
|
|
49
|
+
- More stress testing, prove stability
|
|
50
|
+
- More performance research
|
|
51
|
+
- Make Uma into a first-class app server for Ruby
|
|
52
|
+
- Introduce higher-level
|