mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-04 13:07:11 +00:00
perf(engine): a --gpu render probes the GPU encoders once, not twice (#6638)
* perf(engine,cli): a machine's GPU encoder probe runs once, not on every render * refactor(engine): one shared probe per process, no answer kept on disk
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import {
|
||||
getCachedGpuEncoder,
|
||||
getCompiledGpuEncoders,
|
||||
getGpuEncoderName,
|
||||
getProbeArgs,
|
||||
mapPresetForGpuEncoder,
|
||||
resetCachedGpuEncoder,
|
||||
selectUsableGpuEncoder,
|
||||
} from "./gpuEncoder.js";
|
||||
|
||||
@@ -146,3 +148,12 @@ describe("getProbeArgs", () => {
|
||||
expect(args[args.indexOf("-allow_sw") + 1]).toBe("1");
|
||||
});
|
||||
});
|
||||
|
||||
describe("getCachedGpuEncoder", () => {
|
||||
afterEach(() => resetCachedGpuEncoder());
|
||||
|
||||
it("is one probe however many callers ask while it runs", () => {
|
||||
const first = getCachedGpuEncoder();
|
||||
expect(getCachedGpuEncoder()).toBe(first);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user