@volter/editor-threejs 0.5.131 → 0.5.132

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@volter/editor-threejs",
3
3
  "author": "Volter AI, Inc.",
4
- "version": "0.5.131",
4
+ "version": "0.5.132",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -135,12 +135,12 @@
135
135
  "serving": "./dist-node/serving.mjs"
136
136
  },
137
137
  "dependencies": {
138
- "@volter/editor-project": "0.5.131",
138
+ "@volter/editor-project": "0.5.132",
139
139
  "@sparkjsdev/spark": "^2.1.0",
140
140
  "three.quarks": "^0.16.0",
141
141
  "zod": "^4.3.6",
142
142
  "typescript": "5.9.3",
143
- "@volter/editor-sdk": "0.5.131",
143
+ "@volter/editor-sdk": "0.5.132",
144
144
  "postprocessing": "6.38.3",
145
145
  "quarks.core": "0.16.0",
146
146
  "@fortawesome/free-solid-svg-icons": "^7.2.0"
@@ -2108,11 +2108,19 @@ export function Object3DDocumentViewport({
2108
2108
  const gl = activeRenderer.getContext();
2109
2109
  const pixel = new Uint8Array(4);
2110
2110
  const times: number[] = [];
2111
+ const submitTimes: number[] = [];
2112
+ const completionTimes: number[] = [];
2111
2113
  for (let index = 0; index <= frames; index++) {
2112
2114
  const start = performance.now();
2113
2115
  animate(start, true);
2116
+ const submitted = performance.now();
2114
2117
  gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel);
2115
- if (index > 0) times.push(performance.now() - start);
2118
+ const completed = performance.now();
2119
+ if (index > 0) {
2120
+ times.push(completed - start);
2121
+ submitTimes.push(submitted - start);
2122
+ completionTimes.push(completed - submitted);
2123
+ }
2116
2124
  }
2117
2125
  const drawn = { calls: activeRenderer.info.render.calls, triangles: activeRenderer.info.render.triangles };
2118
2126
  let meshes = 0;
@@ -2130,11 +2138,14 @@ export function Object3DDocumentViewport({
2130
2138
  const size = activeRenderer.getDrawingBufferSize(new THREE.Vector2());
2131
2139
  const ratio = activeRenderer.getPixelRatio();
2132
2140
  const round = (value: number) => Math.round(value * 100) / 100;
2141
+ const median = (values: number[]) => round(values.sort((a, b) => a - b)[Math.floor(values.length / 2)] ?? 0);
2133
2142
  return {
2134
2143
  frames,
2135
2144
  medianMs: round(at(0.5)),
2136
2145
  p95Ms: round(at(0.95)),
2137
2146
  minMs: round(sorted[0] ?? 0),
2147
+ submitMedianMs: median(submitTimes),
2148
+ completionWaitMedianMs: median(completionTimes),
2138
2149
  width: size.x,
2139
2150
  height: size.y,
2140
2151
  cssWidth: round(size.x / ratio),