perf - simplify cached data env var (enabled cached data for the extension host)
This commit is contained in:
parent
d3a6a23449
commit
0c2388a008
2
src/bootstrap-amd.js
vendored
2
src/bootstrap-amd.js
vendored
|
@ -19,7 +19,7 @@ loader.config({
|
|||
nodeRequire: require,
|
||||
nodeMain: __filename,
|
||||
'vs/nls': nlsConfig,
|
||||
nodeCachedDataDir: process.env['VSCODE_NODE_CACHED_DATA_DIR_' + process.pid]
|
||||
nodeCachedDataDir: process.env['VSCODE_NODE_CACHED_DATA_DIR']
|
||||
});
|
||||
|
||||
// Running in Electron
|
||||
|
|
|
@ -90,7 +90,7 @@ function onReady() {
|
|||
process.env['VSCODE_NLS_CONFIG'] = JSON.stringify(nlsConfig);
|
||||
|
||||
if (cachedDataDir) {
|
||||
process.env['VSCODE_NODE_CACHED_DATA_DIR_' + process.pid] = cachedDataDir;
|
||||
process.env['VSCODE_NODE_CACHED_DATA_DIR'] = cachedDataDir;
|
||||
}
|
||||
|
||||
// Load main in AMD
|
||||
|
|
|
@ -218,7 +218,7 @@ export class EnvironmentService implements IEnvironmentService {
|
|||
get sharedIPCHandle(): string { return getIPCHandle(this.userDataPath, 'shared'); }
|
||||
|
||||
@memoize
|
||||
get nodeCachedDataDir(): string { return this.isBuilt ? path.join(this.userDataPath, 'CachedData', product.commit || new Array(41).join('0')) : undefined; }
|
||||
get nodeCachedDataDir(): string { return process.env['VSCODE_NODE_CACHED_DATA_DIR'] || undefined; }
|
||||
|
||||
get disableUpdates(): boolean { return !!this._args['disable-updates']; }
|
||||
get disableCrashReporter(): boolean { return !!this._args['disable-crash-reporter']; }
|
||||
|
|
|
@ -67,19 +67,13 @@ export function sanitizeEnvironment(env: platform.IProcessEnvironment): void {
|
|||
'VSCODE_NLS_CONFIG',
|
||||
'VSCODE_PORTABLE',
|
||||
'VSCODE_PID',
|
||||
'VSCODE_NODE_CACHED_DATA_DIR'
|
||||
];
|
||||
keysToRemove.forEach((key) => {
|
||||
if (env[key]) {
|
||||
delete env[key];
|
||||
}
|
||||
});
|
||||
|
||||
// Remove keys based on regexp
|
||||
Object.keys(env).forEach(key => {
|
||||
if (key.search(/^VSCODE_NODE_CACHED_DATA_DIR_\d+$/) === 0) {
|
||||
delete env[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function addTerminalEnvironmentKeys(env: platform.IProcessEnvironment, isWindows: boolean, locale?: string): void {
|
||||
|
|
Loading…
Reference in a new issue