Skip to content

Commit 094647e

Browse files
authored
Revert "Add chat perf markers (#4456)" (#4508)
This reverts commit 17d32d6.
1 parent e59c952 commit 094647e

File tree

6 files changed

+2
-26
lines changed

6 files changed

+2
-26
lines changed

src/extension/conversation/vscode-node/chatParticipants.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ Learn more about [GitHub Copilot](https://docs.github.com/copilot/using-github-c
196196

197197
private getChatParticipantHandler(id: string, name: string, defaultIntentIdOrGetter: IntentOrGetter): vscode.ChatExtendedRequestHandler {
198198
return async (request, context, stream, token): Promise<vscode.ChatResult> => {
199-
performance.mark('code/chat/ext/willHandleParticipant');
200199
// If we need to switch to the base model, this function will handle it
201200
// Otherwise it just returns the same request passed into it
202201
request = await this.switchToBaseModel(request, stream);
@@ -245,7 +244,6 @@ Learn more about [GitHub Copilot](https://docs.github.com/copilot/using-github-c
245244
}
246245
}
247246

248-
performance.mark('code/chat/ext/didHandleParticipant');
249247
return result;
250248
};
251249
}

src/extension/conversation/vscode-node/conversationFeature.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,13 @@ export class ConversationFeature implements IExtensionContribution {
9494
this.activated = true;
9595
activationBlockerDeferred.complete();
9696
} else {
97-
performance.mark('code/chat/ext/willWaitForCopilotToken');
9897
this.logService.info(`ConversationFeature: Waiting for copilot token to activate conversation feature`);
9998
}
10099

101100
this._disposables.add(authenticationService.onDidAuthenticationChange(async () => {
102101
const hasSession = !!authenticationService.copilotToken;
103102
this.logService.info(`ConversationFeature: onDidAuthenticationChange has token: ${hasSession}`);
104103
if (hasSession) {
105-
performance.mark('code/chat/ext/didWaitForCopilotToken');
106104
this.activated = true;
107105
} else {
108106
this.activated = false;

src/extension/extension/vscode/extension.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export interface IExtensionActivationConfiguration {
3131
}
3232

3333
export async function baseActivate(configuration: IExtensionActivationConfiguration) {
34-
performance.mark('code/chat/ext/willActivate');
3534
const context = configuration.context;
3635
if (context.extensionMode === ExtensionMode.Test && !configuration.forceActivation && !isScenarioAutomation) {
3736
// FIXME Running in tests, don't activate the extension
@@ -66,22 +65,20 @@ export async function baseActivate(configuration: IExtensionActivationConfigurat
6665

6766
// Await intialization of exp service. This ensure cache is fresh.
6867
// It will then auto refresh every 30 minutes after that.
69-
performance.mark('code/chat/ext/willInitExperiments');
7068
await expService.hasTreatments();
7169

7270
// THIS is awaited because some contributions can block activation
7371
// via `IExtensionContribution#activationBlocker`
7472
const contributions = instantiationService.createInstance(ContributionCollection, configuration.contributions);
7573
context.subscriptions.push(contributions);
76-
performance.mark('code/chat/ext/willWaitForActivationBlockers');
7774
await contributions.waitForActivationBlockers();
7875
});
7976

8077
if (ExtensionMode.Test === context.extensionMode && !isScenarioAutomation) {
8178
return instantiationService; // The returned accessor is used in tests
8279
}
8380

84-
const result = {
81+
return {
8582
getAPI(version: number) {
8683
if (version > CopilotExtensionApi.version) {
8784
throw new Error('Invalid Copilot Chat extension API version. Please upgrade Copilot Chat.');
@@ -90,8 +87,6 @@ export async function baseActivate(configuration: IExtensionActivationConfigurat
9087
return instantiationService.createInstance(CopilotExtensionApi);
9188
}
9289
};
93-
performance.mark('code/chat/ext/didActivate');
94-
return result;
9590
}
9691

9792
export function createInstantiationService(configuration: IExtensionActivationConfiguration): IInstantiationService {

src/extension/intents/node/toolCallingLoop.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -731,9 +731,7 @@ export abstract class ToolCallingLoop<TOptions extends IToolCallingLoopOptions =
731731
});
732732

733733
try {
734-
performance.mark('code/chat/ext/willRunLoop');
735734
const result = await this._runLoop(outputStream, token);
736-
performance.mark('code/chat/ext/didRunLoop');
737735
span.setAttributes({
738736
[CopilotChatAttr.TURN_COUNT]: result.toolCallRounds.length,
739737
[GenAiAttr.USAGE_INPUT_TOKENS]: totalInputTokens,
@@ -1040,9 +1038,7 @@ export abstract class ToolCallingLoop<TOptions extends IToolCallingLoopOptions =
10401038
let availableTools = await this.getAvailableTools(outputStream, token);
10411039
const context = this.createPromptContext(availableTools, outputStream);
10421040
const isContinuation = context.isContinuation || false;
1043-
performance.mark('code/chat/ext/willBuildPrompt');
10441041
const buildPromptResult: IBuildPromptResult = await this.buildPrompt2(context, outputStream, token);
1045-
performance.mark('code/chat/ext/didBuildPrompt');
10461042
this.throwIfCancelled(token);
10471043
this.turn.addReferences(buildPromptResult.references);
10481044
// Possible the tool call resulted in new tools getting added.
@@ -1146,7 +1142,6 @@ export abstract class ToolCallingLoop<TOptions extends IToolCallingLoopOptions =
11461142
const disableThinking = isContinuation && isAnthropicFamily(endpoint) && !ToolCallingLoop.messagesContainThinking(effectiveBuildPromptResult.messages);
11471143
let phase: string | undefined;
11481144
let compaction: OpenAIContextManagementResponse | undefined;
1149-
performance.mark('code/chat/ext/willFetch');
11501145
const fetchResult = await this.fetch({
11511146
messages: this.applyMessagePostProcessing(effectiveBuildPromptResult.messages, { stripOrphanedToolCalls: isGeminiFamily(endpoint) }),
11521147
turnId: this.turn.id,
@@ -1196,7 +1191,6 @@ export abstract class ToolCallingLoop<TOptions extends IToolCallingLoopOptions =
11961191
}, token).finally(() => {
11971192
this.stopHookUserInitiated = false;
11981193
});
1199-
performance.mark('code/chat/ext/didFetch');
12001194

12011195
const promptTokenDetails = await computePromptTokenDetails({
12021196
messages: effectiveBuildPromptResult.messages,

src/extension/prompts/node/agent/agentPrompt.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ export class AgentPrompt extends PromptElement<AgentPromptProps> {
9797
if (!customizations) {
9898
throw new Error('AgentPrompt requires customizations to be provided. Use PromptRegistry.resolveAllCustomizations() to resolve them.');
9999
}
100-
performance.mark('code/chat/ext/willGetSystemPrompt');
101100
const instructions = await this.getSystemPrompt(customizations);
102-
performance.mark('code/chat/ext/didGetSystemPrompt');
103101
const CopilotIdentityRules = customizations.CopilotIdentityRulesClass;
104102
const SafetyRules = customizations.SafetyRulesClass;
105103

@@ -210,16 +208,13 @@ export class AgentPrompt extends PromptElement<AgentPromptProps> {
210208
}
211209

212210
private async getOrCreateGlobalAgentContext(endpoint: IChatEndpoint): Promise<PromptPieceChild[]> {
213-
performance.mark('code/chat/ext/willGetGlobalAgentContext');
214211
const globalContext = await this.getOrCreateGlobalAgentContextContent(endpoint);
215212
const isNewChat = this.props.promptContext.history?.length === 0;
216213
// TODO:@bhavyau find a better way to extract session resource
217214
const sessionResource = (this.props.promptContext.tools?.toolInvocationToken as any)?.sessionResource as string | undefined;
218-
const result = globalContext ?
215+
return globalContext ?
219216
renderedMessageToTsxChildren(globalContext, !!this.props.enableCacheBreakpoints) :
220217
<GlobalAgentContext enableCacheBreakpoints={!!this.props.enableCacheBreakpoints} availableTools={this.props.promptContext.tools?.availableTools} isNewChat={isNewChat} sessionResource={sessionResource} />;
221-
performance.mark('code/chat/ext/didGetGlobalAgentContext');
222-
return result;
223218
}
224219

225220
private async getOrCreateGlobalAgentContextContent(endpoint: IChatEndpoint): Promise<Raw.ChatCompletionContentPart[] | undefined> {

src/extension/prompts/node/panel/customInstructions.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ export class CustomInstructions extends PromptElement<CustomInstructionsProps> {
6464
super(props);
6565
}
6666
override async render(state: void, sizing: PromptSizing) {
67-
performance.mark('code/chat/ext/willPrepareCustomInstructions');
6867

6968
const { includeCodeGenerationInstructions, includeTestGenerationInstructions, includeCodeFeedbackInstructions, includeCommitMessageGenerationInstructions, includePullRequestDescriptionGenerationInstructions, customIntroduction } = this.props;
7069
const includeSystemMessageConflictWarning = this.props.includeSystemMessageConflictWarning ?? true;
@@ -129,9 +128,6 @@ export class CustomInstructions extends PromptElement<CustomInstructionsProps> {
129128
chunks.push(chunk);
130129
}
131130
}
132-
133-
performance.mark('code/chat/ext/didPrepareCustomInstructions');
134-
135131
if (chunks.length === 0) {
136132
return undefined;
137133
}

0 commit comments

Comments
 (0)