"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
const benchmark_1 = require("@fluid-tools/benchmark");
const snapshot_utils_js_1 = require("./snapshot.utils.js");
describe("MergeTree snapshots", () => {
    let summary;
    for (const summarySize of [10, 50, 100, 500, 1000, 5000, 10_000]) {
        (0, benchmark_1.benchmark)({
            type: benchmark_1.BenchmarkType.Measurement,
            title: `load snapshot with ${summarySize} segments`,
            category: "snapshot loading",
            before: () => {
                const str = new snapshot_utils_js_1.TestString("id", {});
                for (let i = 0; i < summarySize; i++) {
                    str.append("a", false);
                }
                str.applyPendingOps();
                summary = str.getSummary();
            },
            benchmarkFnAsync: async () => {
                // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
                await (0, snapshot_utils_js_1.loadSnapshot)(summary);
            },
            after: () => {
                summary = undefined;
            },
        });
    }
});
//# sourceMappingURL=Snapshot.perf.spec.js.map