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 for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube