@@ -33,7 +33,7 @@ import { NotebooKernelActionViewItem } from 'vs/workbench/contrib/notebook/brows
33
33
import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookTextModel' ;
34
34
import { NOTEBOOK_EDITOR_ID } from 'vs/workbench/contrib/notebook/common/notebookCommon' ;
35
35
import { NotebookEditorInput } from 'vs/workbench/contrib/notebook/common/notebookEditorInput' ;
36
- import { clearMarks , getAndClearMarks , mark } from 'vs/workbench/contrib/notebook/common/notebookPerformance' ;
36
+ import { NotebookPerfMarks } from 'vs/workbench/contrib/notebook/common/notebookPerformance' ;
37
37
import { IEditorDropService } from 'vs/workbench/services/editor/browser/editorDropService' ;
38
38
import { GroupsOrder , IEditorGroup , IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService' ;
39
39
import { IEditorService } from 'vs/workbench/services/editor/common/editorService' ;
@@ -172,8 +172,8 @@ export class NotebookEditor extends EditorPane implements IEditorPaneWithSelecti
172
172
173
173
override async setInput ( input : NotebookEditorInput , options : INotebookEditorOptions | undefined , context : IEditorOpenContext , token : CancellationToken , noRetry ?: boolean ) : Promise < void > {
174
174
try {
175
- clearMarks ( input . resource ) ;
176
- mark ( input . resource , 'startTime' ) ;
175
+ const perf = new NotebookPerfMarks ( ) ;
176
+ perf . mark ( 'startTime' ) ;
177
177
const group = this . group ! ;
178
178
179
179
this . _inputListener . value = input . onDidChangeCapabilities ( ( ) => this . _onDidChangeInputCapabilities ( input ) ) ;
@@ -203,8 +203,8 @@ export class NotebookEditor extends EditorPane implements IEditorPaneWithSelecti
203
203
// only now `setInput` and yield/await. this is AFTER the actual widget is ready. This is very important
204
204
// so that others synchronously receive a notebook editor with the correct widget being set
205
205
await super . setInput ( input , options , context , token ) ;
206
- const model = await input . resolve ( ) ;
207
- mark ( input . resource , 'inputLoaded' ) ;
206
+ const model = await input . resolve ( perf ) ;
207
+ perf . mark ( 'inputLoaded' ) ;
208
208
209
209
// Check for cancellation
210
210
if ( token . isCancellationRequested ) {
@@ -230,7 +230,7 @@ export class NotebookEditor extends EditorPane implements IEditorPaneWithSelecti
230
230
const viewState = options ?. viewState ?? this . _loadNotebookEditorViewState ( input ) ;
231
231
232
232
this . _widget . value ?. setParentContextKeyService ( this . _contextKeyService ) ;
233
- await this . _widget . value ! . setModel ( model . notebook , viewState ) ;
233
+ await this . _widget . value ! . setModel ( model . notebook , viewState , perf ) ;
234
234
const isReadOnly = input . hasCapability ( EditorInputCapabilities . Readonly ) ;
235
235
await this . _widget . value ! . setOptions ( { ...options , isReadOnly } ) ;
236
236
this . _widgetDisposableStore . add ( this . _widget . value ! . onDidFocusWidget ( ( ) => this . _onDidFocusWidget . fire ( ) ) ) ;
@@ -240,7 +240,7 @@ export class NotebookEditor extends EditorPane implements IEditorPaneWithSelecti
240
240
containsGroup : ( group ) => this . group ?. id === group . id
241
241
} ) ) ;
242
242
243
- mark ( input . resource , 'editorLoaded' ) ;
243
+ perf . mark ( 'editorLoaded' ) ;
244
244
245
245
type WorkbenchNotebookOpenClassification = {
246
246
owner : 'rebornix' ;
@@ -266,8 +266,7 @@ export class NotebookEditor extends EditorPane implements IEditorPaneWithSelecti
266
266
editorLoaded : number ;
267
267
} ;
268
268
269
- const perfMarks = getAndClearMarks ( input . resource ) ;
270
-
269
+ const perfMarks = perf . value ;
271
270
if ( perfMarks ) {
272
271
const startTime = perfMarks [ 'startTime' ] ;
273
272
const extensionActivated = perfMarks [ 'extensionActivated' ] ;
0 commit comments