bicep
bicep copied to clipboard
Extension causes high cpu load
- Issue Type:
Performance - Extension Name:
vscode-bicep - Extension Version:
0.9.1 - OS Version:
Darwin arm64 21.6.0 - VS Code version:
1.70.0
:warning: Make sure to attach this file from your home-directory:
:warning:file:///var/folders/cq/ph9fgfjd4wzgp_7vpqwl90gr0000gn/T/ms-azuretools.vscode-bicep-unresponsive.cpuprofile.txt
Find more details here: https://github.com/microsoft/vscode/wiki/Explain-extension-causes-high-cpu-load
@erreyi - please could you upload the file from the error (/var/folders/cq/ph9fgfjd4wzgp_7vpqwl90gr0000gn/T/ms-azuretools.vscode-bicep-unresponsive.cpuprofile.txt).
If you don't want to share it publicly, feel free to email to me (antmarti at microsoft dot com)
Here's what the profile looks like:
And the method in question:
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
const deployParamsPattern = new RegExp('.*"token":\\s*"(?<token>.*)"');
export function removePropertiesWithPossibleUserInfoInDeployParams(
value: string
): string {
const matches = deployParamsPattern.exec(value);
if (matches) {
const groups = matches.groups;
if (groups) {
const token = groups["token"];
return value.replace(token, "<REDACTED: token>");
}
}
return value;
}
The regex could be optimized (pre-compile, remove the ".*" from the beginning), although it seems unlikely to be causing serious performance issues.
@erreyi Does this happen frequently? Was it a one-time event? Thanks.
Hi erreyi, this issue has been marked as stale because it was labeled as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thanks for contributing to bicep! :smile: :mechanical_arm: