@ntcore-ts/client 1.1.0-beta.1 → 1.1.0-beta.3
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.
- package/README.md +8 -8
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +4738 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/lib/client.d.ts +262 -0
- package/dist/lib/client.d.ts.map +1 -0
- package/dist/lib/index.d.ts +8 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/pubsub/base-topic.d.ts +104 -0
- package/dist/lib/pubsub/base-topic.d.ts.map +1 -0
- package/dist/lib/pubsub/index.d.ts +6 -0
- package/dist/lib/pubsub/index.d.ts.map +1 -0
- package/dist/lib/pubsub/json-topic.d.ts +50 -0
- package/dist/lib/pubsub/json-topic.d.ts.map +1 -0
- package/dist/lib/pubsub/prefix-topic.d.ts +45 -0
- package/dist/lib/pubsub/prefix-topic.d.ts.map +1 -0
- package/dist/lib/pubsub/protobuf-schema-manager.d.ts +96 -0
- package/dist/lib/pubsub/protobuf-schema-manager.d.ts.map +1 -0
- package/dist/lib/pubsub/protobuf-topic.d.ts +126 -0
- package/dist/lib/pubsub/protobuf-topic.d.ts.map +1 -0
- package/dist/lib/pubsub/pubsub.d.ts +134 -0
- package/dist/lib/pubsub/pubsub.d.ts.map +1 -0
- package/dist/lib/pubsub/struct-topic.d.ts +40 -0
- package/dist/lib/pubsub/struct-topic.d.ts.map +1 -0
- package/dist/lib/pubsub/topic.d.ts +134 -0
- package/dist/lib/pubsub/topic.d.ts.map +1 -0
- package/dist/lib/socket/messenger.d.ts +104 -0
- package/dist/lib/socket/messenger.d.ts.map +1 -0
- package/dist/lib/socket/socket.d.ts +202 -0
- package/dist/lib/socket/socket.d.ts.map +1 -0
- package/dist/lib/struct/built-in-schemas.d.ts +21 -0
- package/dist/lib/struct/built-in-schemas.d.ts.map +1 -0
- package/dist/lib/struct/geometry.d.ts +129 -0
- package/dist/lib/struct/geometry.d.ts.map +1 -0
- package/dist/lib/struct/index.d.ts +5 -0
- package/dist/lib/struct/index.d.ts.map +1 -0
- package/dist/lib/struct/struct-codec.d.ts +14 -0
- package/dist/lib/struct/struct-codec.d.ts.map +1 -0
- package/dist/lib/struct/struct-descriptor.d.ts +60 -0
- package/dist/lib/struct/struct-descriptor.d.ts.map +1 -0
- package/dist/lib/struct/struct-parser.d.ts +26 -0
- package/dist/lib/struct/struct-parser.d.ts.map +1 -0
- package/dist/lib/struct/struct-schema-manager.d.ts +41 -0
- package/dist/lib/struct/struct-schema-manager.d.ts.map +1 -0
- package/dist/lib/types/index.d.ts +2 -0
- package/dist/lib/types/index.d.ts.map +1 -0
- package/dist/lib/types/schemas.d.ts +269 -0
- package/dist/lib/types/schemas.d.ts.map +1 -0
- package/dist/lib/types/types.d.ts +66 -0
- package/dist/lib/types/types.d.ts.map +1 -0
- package/dist/lib/util/logger.d.ts +60 -0
- package/dist/lib/util/logger.d.ts.map +1 -0
- package/dist/lib/util/util.d.ts +68 -0
- package/dist/lib/util/util.d.ts.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -20,14 +20,14 @@ const gyro = ntcore.getDoubleTopic('/MyTable/Gyro');
|
|
|
20
20
|
gyro.subscribe((value) => console.log(value));
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
The hot path (msgpack decode +
|
|
23
|
+
The hot path (msgpack decode + shape check) is about **2.6 million frames/s** on an Apple M1 Pro (~0.4 µs per single-message frame). Typical FRC NT rates are tens to low thousands of updates per second.
|
|
24
24
|
|
|
25
25
|
```mermaid
|
|
26
26
|
xychart-beta
|
|
27
27
|
title "Messages per second by frame size (Apple M1 Pro)"
|
|
28
28
|
x-axis ["1 msg/frame", "10 msg/frame", "100 msg/frame"]
|
|
29
|
-
y-axis "thousands of messages/s" 0 -->
|
|
30
|
-
bar [
|
|
29
|
+
y-axis "thousands of messages/s" 0 --> 16000
|
|
30
|
+
bar [2628, 10097, 14297]
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
## Building
|
|
@@ -49,7 +49,7 @@ Benchmarks measure how fast the client processes WebSocket messages. They are **
|
|
|
49
49
|
|
|
50
50
|
**What is measured**
|
|
51
51
|
|
|
52
|
-
- **Tier 1 (hot path)**: Binary frame processing in isolation—decode (msgpack),
|
|
52
|
+
- **Tier 1 (hot path)**: Binary frame processing in isolation—decode (msgpack), shape check, and callback. Benchmarks: one frame with 1, 10, or 100 messages.
|
|
53
53
|
- **Tier 2 (`onMessage`)**: 100 binary frames through `onMessage` → `handleBinaryFrame` → `onTopicUpdate`.
|
|
54
54
|
|
|
55
55
|
Both tiers use a mock server for the socket connection (no real NT server or robot). Results are reported as Hz (ops/sec), with min/max/mean and percentiles (e.g. p99).
|
|
@@ -58,10 +58,10 @@ Both tiers use a mock server for the socket connection (no real NT server or rob
|
|
|
58
58
|
|
|
59
59
|
| Workload | Frames or batches/s | Mean | Messages/s |
|
|
60
60
|
| ------------------------------ | ------------------: | -----: | ---------: |
|
|
61
|
-
| 1 message / frame |
|
|
62
|
-
| 10 messages / frame |
|
|
63
|
-
| 100 messages / frame |
|
|
64
|
-
| 100 frames through `onMessage` |
|
|
61
|
+
| 1 message / frame | 2.63M | 0.4 µs | 2.63M |
|
|
62
|
+
| 10 messages / frame | 1.01M | 1.1 µs | 10.1M |
|
|
63
|
+
| 100 messages / frame | 143k | 7.1 µs | 14.3M |
|
|
64
|
+
| 100 frames through `onMessage` | 16.1k | 63 µs | 1.61M |
|
|
65
65
|
|
|
66
66
|
CI re-runs these benches on every PR and fails if throughput drops to half of `main`. See the [performance guide](https://ntcore.chrislawson.dev/guide/performance).
|
|
67
67
|
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"}
|