Skip to content

Commit 12c6517

Browse files
committed
[chore] timing - remove unused code
1 parent f234abf commit 12c6517

File tree

2 files changed

+5
-50
lines changed

2 files changed

+5
-50
lines changed

src/command/render/pandoc.ts

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,7 @@ import {
181181
processFormatResources,
182182
writeFormatResources,
183183
} from "./pandoc-dependencies-resources.ts";
184-
import {
185-
ExplicitTimingEntry,
186-
getLuaTiming,
187-
insertExplicitTimingEntries,
188-
withTiming,
189-
} from "../../core/timing.ts";
184+
import { withTiming } from "../../core/timing.ts";
190185

191186
import {
192187
requiresShortcodeUnescapePostprocessor,
@@ -1186,9 +1181,6 @@ export async function runPandoc(
11861181
);
11871182
}
11881183

1189-
// workaround for our wonky Lua timing routines
1190-
const luaEpoch = await getLuaTiming();
1191-
11921184
setupPandocEnv();
11931185

11941186
// run beforePandoc hooks
@@ -1231,24 +1223,6 @@ export async function runPandoc(
12311223
}
12321224
}
12331225

1234-
if (existsSync(timingResultsFile)) {
1235-
const timingResultsJSON = Deno.readTextFileSync(timingResultsFile);
1236-
if (
1237-
timingResultsJSON.length > 0 && Deno.env.get("QUARTO_PROFILER_OUTPUT")
1238-
) {
1239-
// workaround for our wonky Lua timing routines
1240-
const luaNow = await getLuaTiming();
1241-
const entries = JSON.parse(timingResultsJSON) as ExplicitTimingEntry[];
1242-
1243-
insertExplicitTimingEntries(
1244-
luaEpoch,
1245-
luaNow,
1246-
entries,
1247-
"pandoc",
1248-
);
1249-
}
1250-
}
1251-
12521226
if (result.success) {
12531227
return {
12541228
inputMetadata: pandocMetadata,

src/core/timing.ts

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
/*
2-
* timing.ts
3-
*
4-
* Copyright (C) 2022 Posit Software, PBC
5-
*
6-
*/
7-
8-
import { execProcess } from "./process.ts";
2+
* timing.ts
3+
*
4+
* Copyright (C) 2022 Posit Software, PBC
5+
*/
96

107
interface TimingNode {
118
name: string;
@@ -128,19 +125,3 @@ export function insertExplicitTimingEntries(
128125
prevTime = theirEnd - theirStart + ourStart;
129126
pop(prevTime);
130127
}
131-
132-
export async function getLuaTiming(): Promise<[number, number]> {
133-
if (Deno.env.get("QUARTO_PROFILER_OUTPUT")) {
134-
return [
135-
Number(
136-
(await execProcess({
137-
cmd: ["python", "-c", "import time; print(time.time() * 1000)"],
138-
stdout: "piped",
139-
})).stdout!,
140-
),
141-
performance.now(),
142-
];
143-
} else {
144-
return [0, 0];
145-
}
146-
}

0 commit comments

Comments
 (0)