carbon_fiber 0.1.1-aarch64-linux → 0.1.3-aarch64-linux
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/README.md +22 -22
- data/lib/carbon_fiber/3.4.0/carbon_fiber_native.so +0 -0
- data/lib/carbon_fiber/4.0.0/carbon_fiber_native.so +0 -0
- data/lib/carbon_fiber/native/fallback.rb +16 -0
- data/lib/carbon_fiber/scheduler.rb +1 -9
- data/lib/carbon_fiber/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a0d1abdfc52ce9b2c2559135c8f0fd3432b21ff9ebeb3db4f695e21fcd43a7da
|
|
4
|
+
data.tar.gz: c248d745f0393e4d823aca33504d0e964da209a7ede364452867265e339bc542
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d5debbce7e0bd737a25c55bea9fef9e307333e87afcea2eb3df188b7b92a6ea540d09e37894b1a24872a44242fcd43e3873d3c49ffee94460137aff725fa33bc
|
|
7
|
+
data.tar.gz: 38492a77b3d92c7aaac9d2b3cf09f3cc051a60b1a675da51733a7da8dfab4d30f13c72b4e7252ced592781c484f4257839ed1d831513249dada5de1a7674b6a2
|
data/README.md
CHANGED
|
@@ -50,18 +50,18 @@ end
|
|
|
50
50
|
|
|
51
51
|
## Performance
|
|
52
52
|
|
|
53
|
-
AWS EC2 c7a.2xlarge, 8 dedicated vCPUs,
|
|
53
|
+
AWS EC2 c7a.2xlarge, 8 dedicated vCPUs, Amazon Linux 2023, kernel 6.18.20, Ruby 4.0.2 + YJIT, io_uring. 5-run median.
|
|
54
54
|
|
|
55
55
|
Some benchmarks:
|
|
56
56
|
|
|
57
57
|
| Workload | Carbon Fiber | Async | Itsi | Carbon Fiber vs. Async |
|
|
58
58
|
|---|---|---|---|---|
|
|
59
|
-
| `http_server` | **
|
|
60
|
-
| `http_client_api` | **
|
|
61
|
-
| `http_client_download` | **
|
|
62
|
-
| `tcp_echo` | **
|
|
63
|
-
| `cascading_timeout` | **4.
|
|
64
|
-
| `connection_pool` | **4.
|
|
59
|
+
| `http_server` | **49.380k req/s** | 30.823k req/s | 30.864k req/s | +60% |
|
|
60
|
+
| `http_client_api` | **19.500k req/s** | 16.721k req/s | timeout | +17% |
|
|
61
|
+
| `http_client_download` | **8.426k dl/s** | 7.062k dl/s | timeout | +19% |
|
|
62
|
+
| `tcp_echo` | **52.973k ops/s** | 32.330k ops/s | 32.046k ops/s | +64% |
|
|
63
|
+
| `cascading_timeout` | **4.668k ops/s** | 4.414k ops/s | error | +6% |
|
|
64
|
+
| `connection_pool` | **4.967k co/s** | 4.612k co/s | 4.954k co/s | +8% |
|
|
65
65
|
|
|
66
66
|
Wins on most workloads against Async, Itsi, fiber_scheduler, io-event, and libev. [See detailed benchmarks →](#benchmarks)
|
|
67
67
|
|
|
@@ -256,7 +256,7 @@ If the native extension can't be loaded (on Windows, for example), a pure-Ruby f
|
|
|
256
256
|
|
|
257
257
|
## Benchmarks
|
|
258
258
|
|
|
259
|
-
AWS EC2 c7a.2xlarge, 8 dedicated vCPUs,
|
|
259
|
+
AWS EC2 c7a.2xlarge, 8 dedicated vCPUs, Amazon Linux 2023, kernel 6.18.20, Ruby 4.0.2 + YJIT, io_uring. 5-run median.
|
|
260
260
|
|
|
261
261
|
### Ruby Fiber Schedulers (leading ones): Carbon Fiber vs. Async vs. Itsi
|
|
262
262
|
|
|
@@ -264,14 +264,14 @@ Measuring pure Ruby Fiber Scheduler performance (`Fiber.set_scheduler`).
|
|
|
264
264
|
|
|
265
265
|
| Workload | Unit | Carbon Fiber | Async | Itsi | Carbon Fiber vs. Async |
|
|
266
266
|
|---|---|---|---|---|---|
|
|
267
|
-
| `http_client_api` | req/s | **
|
|
268
|
-
| `http_client_download` | dl/s | **
|
|
269
|
-
| `http_server` | req/s | **
|
|
270
|
-
| `tcp_echo` | ops/s | **
|
|
271
|
-
| `connection_pool` | co/s | **4,
|
|
272
|
-
| `fan_out_gather` | cyc/s | 2,
|
|
273
|
-
| `db_query_mix` | qry/s | 1,660 | 1,
|
|
274
|
-
| `cascading_timeout` | ops/s | **4,
|
|
267
|
+
| `http_client_api` | req/s | **19,500** | 16,721 | timeout | +17% |
|
|
268
|
+
| `http_client_download` | dl/s | **8,426** | 7,062 | timeout | +19% |
|
|
269
|
+
| `http_server` | req/s | **49,380** | 30,823 | 30,864 | +60% |
|
|
270
|
+
| `tcp_echo` | ops/s | **52,973** | 32,330 | 32,046 | +64% |
|
|
271
|
+
| `connection_pool` | co/s | **4,967** | 4,612 | 4,954 | +8% |
|
|
272
|
+
| `fan_out_gather` | cyc/s | 2,022 | 1,923 | **2,094** | +5% |
|
|
273
|
+
| `db_query_mix` | qry/s | 1,660 | 1,623 | **1,662** | +2% |
|
|
274
|
+
| `cascading_timeout` | ops/s | **4,668** | 4,414 | error | +6% |
|
|
275
275
|
|
|
276
276
|
Enabling YJIT turned out to be very beneficial for Async as well—numbers here are with `--yjit` on both sides.
|
|
277
277
|
|
|
@@ -281,12 +281,12 @@ Swapped the io-event selector for Carbon Fiber's native backend. Same Async code
|
|
|
281
281
|
|
|
282
282
|
| Workload | Unit | Stock Async | Carbon Fiber | Delta |
|
|
283
283
|
|---|---|---|---|---|
|
|
284
|
-
| `http_client_api` | req/s |
|
|
285
|
-
| `http_client_download` | dl/s |
|
|
286
|
-
| `task_churn` | task/s |
|
|
287
|
-
| `condition_signal` | sig/s |
|
|
288
|
-
| `cascading_timeout` | ops/s | 4,
|
|
289
|
-
| `tcp_throughput` | ops/s |
|
|
284
|
+
| `http_client_api` | req/s | 17,119 | **17,323** | +1.2% |
|
|
285
|
+
| `http_client_download` | dl/s | 2,263 | **2,474** | +9.3% |
|
|
286
|
+
| `task_churn` | task/s | 119,477 | **120,985** | +1.3% |
|
|
287
|
+
| `condition_signal` | sig/s | 44,887 | **46,921** | +4.5% |
|
|
288
|
+
| `cascading_timeout` | ops/s | 4,414 | **4,472** | +1.3% |
|
|
289
|
+
| `tcp_throughput` | ops/s | 32,606 | **48,214** | +47.9% |
|
|
290
290
|
|
|
291
291
|
### Examples of how to run benchmarks
|
|
292
292
|
|
|
Binary file
|
|
Binary file
|
|
@@ -124,6 +124,22 @@ module CarbonFiber
|
|
|
124
124
|
flush_ready
|
|
125
125
|
end
|
|
126
126
|
|
|
127
|
+
# Mirrors `Selector#kernel_sleep` on the native side so
|
|
128
|
+
# `Scheduler#kernel_sleep` can delegate to `@selector.kernel_sleep`
|
|
129
|
+
# in both paths. Branches on the duration: nil parks the fiber on
|
|
130
|
+
# the loop without a timer, non-positive yields, positive parks on
|
|
131
|
+
# a native timer for `duration` seconds.
|
|
132
|
+
def kernel_sleep(duration = nil)
|
|
133
|
+
if duration.nil?
|
|
134
|
+
transfer
|
|
135
|
+
elsif duration <= 0
|
|
136
|
+
self.yield
|
|
137
|
+
else
|
|
138
|
+
block(Fiber.current, duration)
|
|
139
|
+
end
|
|
140
|
+
true
|
|
141
|
+
end
|
|
142
|
+
|
|
127
143
|
# Suspend the current fiber until unblocked or timed out.
|
|
128
144
|
def block(fiber, timeout = nil)
|
|
129
145
|
token = nil
|
|
@@ -169,15 +169,7 @@ module CarbonFiber
|
|
|
169
169
|
# Intercept +Kernel#sleep+. Parks the fiber on a native timer.
|
|
170
170
|
# @param duration [Float, nil] seconds to sleep; nil sleeps forever
|
|
171
171
|
def kernel_sleep(duration = nil)
|
|
172
|
-
|
|
173
|
-
transfer
|
|
174
|
-
elsif duration <= 0
|
|
175
|
-
self.yield
|
|
176
|
-
else
|
|
177
|
-
block(nil, duration)
|
|
178
|
-
end
|
|
179
|
-
|
|
180
|
-
true
|
|
172
|
+
@selector.kernel_sleep(duration)
|
|
181
173
|
end
|
|
182
174
|
|
|
183
175
|
# Wait for I/O readiness on a file descriptor.
|
data/lib/carbon_fiber/version.rb
CHANGED