mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-24 17:24:53 -05:00
Adds performance logging
This commit is contained in:
@@ -4,6 +4,7 @@ import { Annotations, endOfLineIndex } from './annotations';
|
||||
import { FileAnnotationType } from './annotationController';
|
||||
import { AnnotationProviderBase } from './annotationProvider';
|
||||
import { GitService, GitUri } from '../gitService';
|
||||
import { Logger } from '../logger';
|
||||
|
||||
export class RecentChangesAnnotationProvider extends AnnotationProviderBase {
|
||||
|
||||
@@ -20,6 +21,8 @@ export class RecentChangesAnnotationProvider extends AnnotationProviderBase {
|
||||
const diff = await this.git.getDiffForFile(this.uri, commit.previousSha);
|
||||
if (diff === undefined) return false;
|
||||
|
||||
const start = process.hrtime();
|
||||
|
||||
const cfg = this._config.annotations.file.recentChanges;
|
||||
const dateFormat = this._config.defaultDateFormat;
|
||||
|
||||
@@ -62,6 +65,9 @@ export class RecentChangesAnnotationProvider extends AnnotationProviderBase {
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user