ugly-game 0.15.19 → 0.15.20
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/dist/flightRecorder.js +9 -6
- package/package.json +1 -1
package/dist/flightRecorder.js
CHANGED
|
@@ -7,11 +7,11 @@ const DEFAULT_CHECKPOINT_TIMEOUT_MS = 1_000;
|
|
|
7
7
|
const DEFAULT_MAX_RECORDS = 30_000;
|
|
8
8
|
const CHANNEL_FRACTIONS = {
|
|
9
9
|
inputs: 0.28,
|
|
10
|
-
lifecycle: 0.
|
|
11
|
-
frames: 0.
|
|
12
|
-
workers: 0.
|
|
13
|
-
renderer: 0.
|
|
14
|
-
appEvents: 0.
|
|
10
|
+
lifecycle: 0.06,
|
|
11
|
+
frames: 0.43,
|
|
12
|
+
workers: 0.06,
|
|
13
|
+
renderer: 0.06,
|
|
14
|
+
appEvents: 0.07,
|
|
15
15
|
hashes: 0.04,
|
|
16
16
|
};
|
|
17
17
|
const encoder = new TextEncoder();
|
|
@@ -123,7 +123,10 @@ class FlightRecorderImpl {
|
|
|
123
123
|
this.memoryBytes = config.memoryBytes ?? DEFAULT_MEMORY_BYTES;
|
|
124
124
|
if (!Number.isInteger(this.memoryBytes) || this.memoryBytes < 16 * 1024)
|
|
125
125
|
throw new RangeError('flight recorder memoryBytes must be at least 16384');
|
|
126
|
-
|
|
126
|
+
// Production checkpoints may legitimately carry compact collision
|
|
127
|
+
// authority as well as simulation scalars. Reserve enough for the measured
|
|
128
|
+
// ~570 KiB AMS checkpoint while keeping the total hard-capped at 2 MiB.
|
|
129
|
+
this.checkpointBudget = Math.floor(this.memoryBytes * 0.35);
|
|
127
130
|
const ringBudget = this.memoryBytes - this.checkpointBudget;
|
|
128
131
|
const requestedRecords = config.maxRecords ?? DEFAULT_MAX_RECORDS;
|
|
129
132
|
const rings = {};
|