mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-16 10:58:34 -05:00
Adds performance logging
This commit is contained in:
@@ -6,6 +6,7 @@ import { Annotations, endOfLineIndex } from './annotations';
|
|||||||
import { BlameAnnotationProviderBase } from './blameAnnotationProvider';
|
import { BlameAnnotationProviderBase } from './blameAnnotationProvider';
|
||||||
import { GlyphChars } from '../constants';
|
import { GlyphChars } from '../constants';
|
||||||
import { GitBlameCommit, ICommitFormatOptions } from '../gitService';
|
import { GitBlameCommit, ICommitFormatOptions } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
|
||||||
export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase {
|
export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase {
|
||||||
|
|
||||||
@@ -15,7 +16,7 @@ export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase {
|
|||||||
const blame = await this.getBlame(true);
|
const blame = await this.getBlame(true);
|
||||||
if (blame === undefined) return false;
|
if (blame === undefined) return false;
|
||||||
|
|
||||||
// console.time('Computing blame annotations...');
|
const start = process.hrtime();
|
||||||
|
|
||||||
const cfg = this._config.annotations.file.gutter;
|
const cfg = this._config.annotations.file.gutter;
|
||||||
|
|
||||||
@@ -114,7 +115,8 @@ export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase {
|
|||||||
this.editor.setDecorations(this.decoration!, decorations);
|
this.editor.setDecorations(this.decoration!, decorations);
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.timeEnd('Computing blame annotations...');
|
const duration = process.hrtime(start);
|
||||||
|
Logger.log(`${(duration[0] * 1000) + Math.floor(duration[1] / 1000000)} ms to compute gutter blame annotations`);
|
||||||
|
|
||||||
this.selection(shaOrLine, blame);
|
this.selection(shaOrLine, blame);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { FileAnnotationType } from './annotationController';
|
|||||||
import { Annotations, endOfLineIndex } from './annotations';
|
import { Annotations, endOfLineIndex } from './annotations';
|
||||||
import { BlameAnnotationProviderBase } from './blameAnnotationProvider';
|
import { BlameAnnotationProviderBase } from './blameAnnotationProvider';
|
||||||
import { GitBlameCommit } from '../gitService';
|
import { GitBlameCommit } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
|
||||||
export class HoverBlameAnnotationProvider extends BlameAnnotationProviderBase {
|
export class HoverBlameAnnotationProvider extends BlameAnnotationProviderBase {
|
||||||
|
|
||||||
@@ -13,7 +14,7 @@ export class HoverBlameAnnotationProvider extends BlameAnnotationProviderBase {
|
|||||||
const blame = await this.getBlame(this._config.annotations.file.hover.heatmap.enabled);
|
const blame = await this.getBlame(this._config.annotations.file.hover.heatmap.enabled);
|
||||||
if (blame === undefined) return false;
|
if (blame === undefined) return false;
|
||||||
|
|
||||||
// console.time('Computing blame annotations...');
|
const start = process.hrtime();
|
||||||
|
|
||||||
const cfg = this._config.annotations.file.hover;
|
const cfg = this._config.annotations.file.hover;
|
||||||
|
|
||||||
@@ -55,7 +56,8 @@ export class HoverBlameAnnotationProvider extends BlameAnnotationProviderBase {
|
|||||||
this.editor.setDecorations(this.decoration!, decorations);
|
this.editor.setDecorations(this.decoration!, decorations);
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.timeEnd('Computing blame annotations...');
|
const duration = process.hrtime(start);
|
||||||
|
Logger.log(`${(duration[0] * 1000) + Math.floor(duration[1] / 1000000)} ms to compute hover blame annotations`);
|
||||||
|
|
||||||
this.selection(shaOrLine, blame);
|
this.selection(shaOrLine, blame);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { Annotations, endOfLineIndex } from './annotations';
|
|||||||
import { FileAnnotationType } from './annotationController';
|
import { FileAnnotationType } from './annotationController';
|
||||||
import { AnnotationProviderBase } from './annotationProvider';
|
import { AnnotationProviderBase } from './annotationProvider';
|
||||||
import { GitService, GitUri } from '../gitService';
|
import { GitService, GitUri } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
|
||||||
export class RecentChangesAnnotationProvider extends AnnotationProviderBase {
|
export class RecentChangesAnnotationProvider extends AnnotationProviderBase {
|
||||||
|
|
||||||
@@ -20,6 +21,8 @@ export class RecentChangesAnnotationProvider extends AnnotationProviderBase {
|
|||||||
const diff = await this.git.getDiffForFile(this.uri, commit.previousSha);
|
const diff = await this.git.getDiffForFile(this.uri, commit.previousSha);
|
||||||
if (diff === undefined) return false;
|
if (diff === undefined) return false;
|
||||||
|
|
||||||
|
const start = process.hrtime();
|
||||||
|
|
||||||
const cfg = this._config.annotations.file.recentChanges;
|
const cfg = this._config.annotations.file.recentChanges;
|
||||||
const dateFormat = this._config.defaultDateFormat;
|
const dateFormat = this._config.defaultDateFormat;
|
||||||
|
|
||||||
@@ -62,6 +65,9 @@ export class RecentChangesAnnotationProvider extends AnnotationProviderBase {
|
|||||||
|
|
||||||
this.editor.setDecorations(this.highlightDecoration!, decorators);
|
this.editor.setDecorations(this.highlightDecoration!, decorators);
|
||||||
|
|
||||||
|
const duration = process.hrtime(start);
|
||||||
|
Logger.log(`${(duration[0] * 1000) + Math.floor(duration[1] / 1000000)} ms to compute recent changes annotations`);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user