News

Visual Studio Code Python Update Speeds Jupyter Notebook Editor

Faster start-up times for the Jupyter Notebook editor and associated server highlight the February update to the wildly popular Python Extension for Visual Studio Code.

The team improved the performance of the Notebook editor in the January release and continued that effort to make it even faster in the new update. Luciana de Melo e Abud, program manager for the tool, reported 2-3X improvements in speed when opening the Jupyter Notebook editor and in starting up the companion Jupyter server. "First cell execution is also faster as the Jupyter server now spins up in the background automatically when notebooks are opened," she said.

Jupyter Notebooks have been getting a lot of attention in the Microsoft-centric development world lately, as the company's .NET team just recently detailed improvements to the Jupyter-Notebooks-in-.NET-Core experience, what Microsoft calls .NET Notebooks, now in preview.

In the new Python extension update announced Feb. 11, the company also addressed developer feedback about many notifications being thrown when they opened a workspace already configured for VS Code without having an interpreter selected. "Previously, the installation would fail because no interpreter was selected in the workspace," de Melo e Abud said. "In this release, we scaled back the notification prompts for tools installation. They are now only displayed if an interpreter is selected."

As noted in the changelog, the team also closed 66 issues, including two associated with the improvements mentioned above.

A few issues called out for special attention by de Melo e Abud include the following, with thanks shouted out to community contributors:

  • Automatically start the Jupyter server when opening a notebook or the interative window. (#7232)
  • Don't display output panel when building workspace symbols. (#9603)
  • Fix to a crash when using pytest to discover doctests with unknown line number. (thanks Olivier Grisel) (#7487)
  • Update Chinese (Traditional) translation. (thanks pan93412) (#9548)

The VS Code Python program manager also took an opportunity to remind developers of a feature introduced previously that they might have missed.

Jump To Cursor in Animated Action
[Click on image for larger, animated GIF view.]Jump To Cursor in Animated Action (source: Microsoft).

"Although it's not part of the new improvements included in this release, the Python debugger supports a feature that doesn't seem to be widely known: Jump to Cursor," she said. "When you start a debug session and the debugger hits a breakpoint, you can right click on any part of your code – before or after the point where the breakpoint was hit, and select “Jump to Cursor”. This will make the debugger continue its execution from that selected line onward.

"So if you want to execute pieces of code that the debugger had already passed through, you don't need to restart the debug session and wait for the execution to reach that point again. You can simply set it to jump to the line you wish to execute."

The previous work to improve Jupyter functionality in last month's update mentioned by de Melo e Abud included:

  • Kernel selection in Jupyter Notebooks: "In the top right of the Notebook Editor and the Interactive Window, you will now be able to see the current kernel that the notebook is using along with the kernel status (i.e. whether it is idle, busy, etc…). This release also allows you to change your kernel to other Python kernels. To change your current active kernel, click on the current kernel to bring up the VS Code kernel selector and select which kernel you want to switch to from the list."
  • Performance improvements in the Jupyter Notebook editor: "This release includes many improvements to the performance of Jupyter in VS Code in both the Notebook editor and the Interactive Window. This was accomplished through caching previous kernels and through optimizing the search for Jupyter. Some of the significant improvements due to these changes are:

    • Initial starting of the Jupyter server is faster, and subsequent starts of the Jupyter server are more than 2X faster
    • Creating a blank new Jupyter notebook is 2X faster
    • Opening Jupyter Notebooks (especially with a large file size) is now 2x faster

The Python Extension for Visual Studio Code can be installed right from the editor's extension gallery or by downloading it from the Visual Studio Code Marketplace, where it sports an average 4.4 rating (scale to 5) from 298 developers who reviewed it. The extension has now been installed more than 16 million times, making it by far the most popular tool in the extension marketplace.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube