Skip to content

Commit 9cbf097

Browse files
move target index cache metrics to own module
this was causing dependencies to blow up where quarto-latexmk was trying to load all execution engines
1 parent 20ace90 commit 9cbf097

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

src/core/performance/metrics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Copyright (C) 2020-2023 Posit Software, PBC
55
*/
66

7-
import { inputTargetIndexCacheMetrics } from "../../project/project-index.ts";
7+
import { inputTargetIndexCacheMetrics } from "../../project/target-index-cache-metrics.ts";
88
import { functionTimes } from "./function-times.ts";
99
import { Stats } from "./stats.ts";
1010

src/project/project-index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import { dirname, isAbsolute, join, relative } from "../deno_ral/path.ts";
88

99
import * as ld from "../core/lodash.ts";
10+
import { inputTargetIndexCacheMetrics } from "./target-index-cache-metrics.ts";
1011

1112
import {
1213
InputTarget,
@@ -213,11 +214,6 @@ export function inputTargetIsEmpty(index: InputTargetIndex) {
213214
}
214215

215216
const inputTargetIndexCache = new Map<string, InputTargetIndex>();
216-
export const inputTargetIndexCacheMetrics = {
217-
hits: 0,
218-
misses: 0,
219-
invalidations: 0,
220-
};
221217

222218
function readInputTargetIndexIfStillCurrent(projectDir: string, input: string) {
223219
const inputFile = join(projectDir, input);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* target-index-cache-metrics.ts
3+
*
4+
* Copyright (C) 2020-2023 Posit Software, PBC
5+
*/
6+
7+
/**
8+
* Performance metrics for the input target index cache
9+
* Tracks cache efficiency for optional performance profiling
10+
*/
11+
export const inputTargetIndexCacheMetrics = {
12+
hits: 0,
13+
misses: 0,
14+
invalidations: 0,
15+
};

0 commit comments

Comments
 (0)