Skip to content

Windows Timer Resolution always increased to 1ms while code.exe is running #86224

Closed

Description

@zEdS15B3GCwq

Issue Type: Performance Issue

Launching code.exe always sets platform time resolution to ~1ms (instead of the default ~10-15ms), which stays increased until the vscode window is closed. Apparently, this behaviour wastes power and is not recommended by Microsoft.

For reference, a similar issue is known to affect Visual Studio (not Code) WPF, as far as I am aware.

Method:

  1. With and without extensions (--disable-extensions)
  2. 2 Windows PCs: w10 x64 Home (this) and another Pro
  3. Timer resolution checked using SysInternals clockres64.exe
  4. "powercfg -energy duration 5" also identified code.exe as the source of the resolution increase
  5. Balanced power cfg mode, wall power. Haven't tried laptop on battery or other power cfg modes.

VS Code version: Code 1.40.2 (f359dd6, 2019-11-25T14:54:45.096Z)
OS version: Windows_NT x64 10.0.18363

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (12 x 3696)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.94GB (23.13GB free)
Process Argv
Screen Reader no
VM 0%
Process Info
CPU %	Mem MB	   PID	Process
    0	    79	 13536	code main
    0	   158	  1668	   window (t.py - 201911 - Visual Studio Code)
    0	    36	 12876	     searchService
    0	   101	 13660	     extensionHost
    0	    31	 13548	       electron_node bundle.js 
    0	    12	 15072	     watcherService 
    0	    11	 13456	       console-window-host (Windows internal process)
    1	   109	  4516	   gpu-process
    1	    68	  6456	   window (Issue Reporter)
    0	    71	 13020	   shared-process
Workspace Info
|  Window (t.py - 201911 - Visual Studio Code)
|    Folder (201911): 165 files
|      File types: json(138) py(7) pyc(4) bak(3)
|      Conf files: settings.json(1);
Extensions (18)
Extension Author (truncated) Version
vscode-json and 1.5.0
vscode-django bat 0.19.0
django-html bib 1.3.0
django-snippets bib 1.1.1
vscode-eslint dba 1.9.1
python-extension-pack don 1.6.0
MagicPython mag 1.1.0
vscode-docker ms- 0.9.0
mssql ms- 1.7.1
pyright ms- 1.1.7
anaconda-extension-pack ms- 1.0.1
python ms- 2019.11.50794
vscode-typescript-tslint-plugin ms- 1.2.3
vscode-json-editor nic 0.2.3
quicktype qui 12.0.46
vscode-yaml red 0.6.1
vscodeintellicode Vis 1.2.0
jinja who 0.0.8

Activity

  1. added
    terminal
    on Dec 4, 2019
  2. deepak1556 commented on Dec 7, 2019

    @deepak1556
    Collaborator

    Thanks for the report, this is due to using the backgroundThrottling option from electron. At the moment I would say this is as designed but we are looking to remove this, so will leave this issue open for updates.

    /cc Benjamin Pasero (@bpasero) FYI

  3. added
    confirmed
    electron
    windows
    and removed
    terminal
    on Dec 7, 2019
  4. deepak1556 commented on Nov 5, 2020

    @deepak1556
    Collaborator

    We no longer disable backgroundThrottling, can you confirm if this is still an issue with latest stable ?

  5. added
    info-needed
    on Nov 5, 2020
  6. vscode-triage-bot commented on Nov 15, 2020

    @vscode-triage-bot

    This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

    Happy Coding!

  7. locked and limited conversation to collaborators on Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

confirmedelectroninfo-neededperfwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions