Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perf notebook start kernel #8334

Merged
merged 5 commits into from
Nov 23, 2021
Merged

Perf notebook start kernel #8334

merged 5 commits into from
Nov 23, 2021

Conversation

DonJayamanne
Copy link
Contributor

Par of #7849

@DonJayamanne DonJayamanne requested a review from a team as a code owner November 23, 2021 00:00
@codecov-commenter
Copy link

codecov-commenter commented Nov 23, 2021

Codecov Report

Merging #8334 (ed0e737) into main (e79976e) will decrease coverage by 0%.
The diff coverage is 72%.

@@          Coverage Diff           @@
##            main   #8334    +/-   ##
======================================
- Coverage     72%     71%    -1%     
======================================
  Files        373     374     +1     
  Lines      23373   23544   +171     
  Branches    3589    3622    +33     
======================================
+ Hits       16829   16896    +67     
- Misses      5086    5186   +100     
- Partials    1458    1462     +4     
Impacted Files Coverage Δ
.../datascience/notebook/notebookControllerManager.ts 73% <50%> (-1%) ⬇️
...t/datascience/kernel-launcher/localKernelFinder.ts 82% <77%> (-2%) ⬇️
src/client/common/installer/productInstaller.ts 50% <0%> (-12%) ⬇️
...science/jupyter/kernels/kernelDependencyService.ts 80% <0%> (-3%) ⬇️
...ence/editor-integration/cellHashProviderFactory.ts 97% <0%> (-3%) ⬇️
src/client/datascience/errors/errorHandler.ts 57% <0%> (-1%) ⬇️
...cience/data-viewing/dataViewerDependencyService.ts 87% <0%> (ø)
...interpreter/jupyterInterpreterDependencyService.ts 75% <0%> (ø)
src/client/common/installer/backupPipInstaller.ts 25% <0%> (ø)
src/client/common/utils/localize.ts 95% <0%> (+<1%) ⬆️
... and 3 more

@DonJayamanne DonJayamanne merged commit e10720c into main Nov 23, 2021
@DonJayamanne DonJayamanne deleted the perfNotebookStartKernel branch November 23, 2021 02:33
(await this.fs.localFileExists(preferredKernelFromCache.interpreter.path))
) {
traceInfo(`Freferred kernel connection found in cache ${preferredKernelFromCache.id}`);
return preferredKernelFromCache;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to search through all the kernels if we have a cached kernel that matches exactly with what's in the notebook metadata.

const uniqueItems = new Map<string, LocalKernelConnectionMetadata>();
items.forEach((item) => uniqueItems.set(item.id, item));
kernels.forEach((item) => uniqueItems.set(item.id, item));
await this.globalState.update(LocalKernelSpecConnectionsCacheKey, Array.from(uniqueItems.values()));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cache all local kernel connections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants