2

Closed

Improve Compiler 0.9 Speed

description

The compiler speed is insanely slow now. Changing 1 letter takes me 20 seconds on a very fast machine. Even an empty file with no references, just 5 loc takes several seconds.

Please improve the speed (as promised already) as soon as possible. Thank you!

This is by far the most important issue on my side, codebase of some 1000 lines with jquery among others works pretty fine with this release.
Closed Jul 12, 2013 at 1:04 AM by danquirk
Thanks for the update. It sounds like you're going to want to disable Web Essentials (or at least all the Typescript specific features). There are definitely compiler speed improvements we're intending to make before release but these ones appear to be largely related to how Web Essentials is behaving. If you can isolate any issues without Web Essentials feel free to re-open this issue, we'll be driving down compiler performance over time regardless.

comments

thoest wrote Jul 1, 2013 at 9:47 AM

I got the same issue.

For example deleting a file from the project, makes studio hang for 10-20 sec and the compiler maxes out the cpu.

RyanCavanaugh wrote Jul 1, 2013 at 4:34 PM

We haven't seen this anywhere internally. Can anyone seeing this post their basic machine specs (CPU speed, # of cores, RAM, HDD, etc) and configuration (OS, 32- or 64-bit, which version of VS, etc) you're using so we can try to narrow down what's happening?

RyanCavanaugh wrote Jul 1, 2013 at 4:35 PM

See comment - please reopen with more info. Thanks!

** Closed by RyanCavanaugh 07/01/2013 9:35AM

thulka wrote Jul 1, 2013 at 9:39 PM

thoest, yes, that's what happens on my machine exactly. I even had to reconfigure my cpu fan since all cores are constantly working, which is hard to understand why.

i finally switched back to 0.8, code changes were not as hard as i thought, and speed feels Ultra-superfast now.

my computer is perfect mainstream:
core i7-3770
32GB RAM
all SSD discs
win8 64
VS 2012 ultimate
Web Essentials

narrowing it down:
  1. maybe the issue is related to web essentials, although i would not see why.
  2. a simple file with 200 loc using jquery.d.ts and some smaller libs takes exactly 15 sec with tsc isolated.
  3. web essentials is configured to compile on save. even if i do not save anything, cores heat up with tsc often causing vs to freeze. i assume this is related to the language serive's IntelliSense. my typescript codebase has about 2000 to 4000 loc. includes are:
jquery.d.ts
linq.d.ts
signalr.d.ts

thank you for caring, i have a very strong interest to make 0.9 workable, if i can help in any way pls tell me, would also be available via skype.

if it helps, i can strip down my (secret) codebase so i can send it to you.


//////////////////////////////////////////////////// below a copy made from the vs about dialog. /////////////


Microsoft Visual Studio Ultimate 2012
Version 11.0.60610.01 Update 3
Microsoft .NET Framework
Version 4.5.50709

Installed Version: Ultimate

Architecture and Modeling Tools 04940-004-0038003-02708
Microsoft Architecture and Modeling Tools

UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

Team Explorer for Visual Studio 2012 04940-004-0038003-02708
Microsoft Team Explorer for Visual Studio 2012

Visual Basic 2012 04940-004-0038003-02708
Microsoft Visual Basic 2012

Visual C# 2012 04940-004-0038003-02708
Microsoft Visual C# 2012

Visual C++ 2012 04940-004-0038003-02708
Microsoft Visual C++ 2012

Visual F# 2012 04940-004-0038003-02708
Microsoft Visual F# 2012

Visual Studio 2012 Code Analysis Spell Checker 04940-004-0038003-02708
Microsoft® Visual Studio® 2012 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

AWS Toolkit for Visual Studio 2012 1.4.0.0
AWS Toolkit for Visual Studio 2012.
Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.

This software includes third party software subject to the following copyrights:
Cobisi.RoutingAssistant 1.0
http://cobisi.com

Color Theme Designer 1.0
Designer for creating new color themes

Favorite Documents 1.5
Favorites menu for Visual Studio IDE.

JetBrains ReSharper 7.0.1 Full Edition build 7.0.1098.2760 on 2012-08-27T14:31:12
JetBrains ReSharper 7.0.1 package for Microsoft Visual Studio. For more information about ReSharper, visit http://www.jetbrains.com/resharper/. Copyright © 2003–2013 JetBrains, Inc.

Mercurial Source Control Package 1.9
This package implements the functionalities of a source control provider package.

Microsoft Python Tools for Visual Studio 1.5.50917.0
Python Tools for Visual Studio provides intellisense, project support, project and item templates, as well as a REPL window for Python development.

Microsoft Python Tools for Visual Studio - Django Integration 1.5.50917.0
Provides templates and integration for the Django web framework.

Microsoft Python Tools for Visual Studio - HPC Support 1.5.50917.0
HPC support for Python projects including MPI cluster launch and debugging.

Microsoft Python Tools for Visual Studio - Profiling Support 1.5.50917.0
Profiling support for Python projects.

NuGet Package Manager 2.6.40619.9041
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

SQL Server Data Tools 11.1.20905.0
Microsoft SQL Server Data Tools

tangible T4 Editor 2.1.1
tangible engineering GmbH

Visual Studio 11 Editor Extension 1.0
Information about my package

VisualHG 1.1.5
Mercurial source contol provider.

Web Developer Tools 1.2.40308.0
Microsoft Web Developer Tools contains the following components:
Page Inspector: Tool that offers an efficient way to decompose Web Applications and diagnose front-end issues.
Web Publishing: Extensions required for Web Publishing for both hosted servers as well as on premises.
Web Form Templates: Includes the default templates for Web Form Applications.
Editor Extensions: Includes HTML, CSS, and JS editor extensions that greatly enhance the development experience.

Windows Azure Tools October 2012
Windows Azure Tools for Microsoft Visual Studio 2012 - October 2012 v1.8.51019.1603

Windows Installer XML Toolset 3.7
Windows Installer XML Toolset 3.7.1224.0
Copyright © Outercurve Foundation. All rights reserved.

Git Extensions
Git Extensions is a graphical interface for Git
For more information about Git Extensions, see the Git Extensions website at
http://code.google.com/p/gitextensions/
Copyright © 2012 Henk Westhuis

thoest wrote Jul 2, 2013 at 6:48 AM

Specs below, fastest machine i have ever used.

System:

OS Name Microsoft Windows 8 Pro
Version 6.2.9200 Build 9200
Other OS Description Not Available
OS Manufacturer Microsoft Corporation
System Manufacturer LENOVO
System Model 25522P5
System Type x64-based PC
System SKU LENOVO_MT_2552
Processor Intel(R) Xeon(R) CPU E3-1225 V2 @ 3.20GHz, 3193 Mhz, 4 Core(s), 4 Logical Processor(s)
BIOS Version/Date LENOVO 9SKT61AUS, 27-02-2013
SMBIOS Version 2.7
Embedded Controller Version 255.255
BIOS Mode Legacy
BaseBoard Manufacturer LENOVO
BaseBoard Model Not Available
BaseBoard Name Base Board
Platform Role Workstation
Secure Boot State Unsupported
PCR7 Configuration Not Available
Windows Directory C:\WINDOWS
System Directory C:\WINDOWS\system32
Boot Device \Device\HarddiskVolume1
Locale United States
Hardware Abstraction Layer Version = "6.2.9200.16442"
Time Zone Romance Daylight Time
Installed Physical Memory (RAM) 16,0 GB
Total Physical Memory 15,8 GB
Available Physical Memory 7,89 GB
Total Virtual Memory 18,0 GB
Available Virtual Memory 9,27 GB
Page File Space 2,25 GB
Page File C:\pagefile.sys

Visual studio

Microsoft Visual Studio Premium 2012
Version 11.0.60315.01 Update 2
Microsoft .NET Framework
Version 4.5.50709

Installed Version: Premium

LightSwitch for Visual Studio 2012 04941-004-0043007-02239
Microsoft LightSwitch for Visual Studio 2012

Office Developer Tools 04941-004-0043007-02239
Microsoft Office Developer Tools

Team Explorer for Visual Studio 2012 04941-004-0043007-02239
Microsoft Team Explorer for Visual Studio 2012

Visual Basic 2012 04941-004-0043007-02239
Microsoft Visual Basic 2012

Visual C# 2012 04941-004-0043007-02239
Microsoft Visual C# 2012

Visual C++ 2012 04941-004-0043007-02239
Microsoft Visual C++ 2012

Visual F# 2012 04941-004-0043007-02239
Microsoft Visual F# 2012

Visual Studio 2012 Code Analysis Spell Checker 04941-004-0043007-02239
Microsoft® Visual Studio® 2012 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Visual Studio 2012 SharePoint Developer Tools 04941-004-0043007-02239
Microsoft Visual Studio 2012 SharePoint Developer Tools

NuGet Package Manager 2.2.40116.9051
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer 1.0
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools 11.1.20627.00
Microsoft SQL Server Data Tools

Telerik Test Studio 2012.2.1420.0
Telerik Test Studio Express Edition. For more information see http://www.telerik.com/automated-testing-tools/products/webui-test-studio-developer-edition.aspx.

Visual Studio 11 Editor Extension 1.0
Information about my package

Web Developer Tools 1.2.40308.0
Microsoft Web Developer Tools contains the following components:
Page Inspector: Tool that offers an efficient way to decompose Web Applications and diagnose front-end issues.
Web Publishing: Extensions required for Web Publishing for both hosted servers as well as on premises.
Web Form Templates: Includes the default templates for Web Form Applications.
Editor Extensions: Includes HTML, CSS, and JS editor extensions that greatly enhance the development experience.

schungx wrote Jul 2, 2013 at 8:28 AM

This has been happening to me ever since 0.9 alpha.

Every single character change in the Visual Studio code editor seems to spawn a compiler instance for type checking. And the compiler is much much slower than 0.8, which means that typing characters are usually a painful process.

I ended up editing all my TypeScript files in NotePad (!!!) and just viewing them in Visual Studio... The Horror...

schungx wrote Jul 2, 2013 at 8:30 AM

Forgot to mention. My machine is a ThinkPad X220 x64 with 6GB of RAM and an i5-2410M @2.3GHz. Not the latest or greatest, but 0.8 has been lightning-fast compared to 0.9...

oisin wrote Jul 5, 2013 at 1:49 PM

Yes, I can confirm that 0.9.0.1 is at least half the speed compared to 0.8.3.1. It is disgustingly slow, especially when just writing code into the editor. I feel like I'm working over a 9600 baud modem.

oisin wrote Jul 5, 2013 at 4:40 PM

It looks like disabling Web Essentials (v2.7 for me) helped mitigate this. The language service is still slower than 0.8.x but not cripplingly so, anymore.

billti wrote Jul 10, 2013 at 7:39 PM

Reopening this. Note: Per the close comment, it stated to "please reopen with more info". I see folks added more info, but if you don't also reopen, this is still a closed issue. Please be sure to reopen also so it gets flagged in our queries.

Thanks for the update oisin. Unfortunately we have seen some customers encounter some issues with Web Essentials & TypeScript. This can spin up instances of the compiler for a number of reasons. TypeScript itself only spins up tsc.exe from within MSBuild (i.e. when you build a project). Other TypeScript activities (including TypeScript's 'Compile on Save', which is done by the language service in VS), don't spin up tsc.exe.

schungx, you mention you are seeing compiler instances just by typing. Please check any installed extensions for something causing this behavior, as it is unlikely to be TypeScript itself.

As preliminary data, we have observed that tsc.exe instances can get created in Web Essentials with the following options & activities (Note: We are still actively investigating to confirm these, and providing early hypothesis to help with troubleshooting)
  1. Add generated files to project
    • Causes tsc.exe to spawn when the solution is opened.
  2. Compile All TypeScript files on build
    • Spawns a new instance of tsc.exe for each d.ts and .ts file (possibly from the UI thread, and waiting until completion).
  3. Compile TypeScript on save
    • Spawns a new instance of tsc.exe to compile the file (and perhaps its references - which it appears can result in multiple instance). Note: The native TypeScript implementation uses a the TypeScript Language Service to regenerate just the file in question, so should be very fast, but it does use the same thread as intellisense uses to generate completion list data, so this could see a minor 'hiccup' on a large compile)
  4. Show preview window
    • Requires the Web Essentials “Compile on Save” option to be enabled. Se above.
If you have any of these settings enabled, please try disabling and see if you continue to see the same issues, and report back with findings. Thanks.

schungx wrote Jul 11, 2013 at 7:57 AM

Bit more info:
  • Yes, I have Web Essentials on and "Compile to Save" turned on from Web Essentials
  • Confirmed that Web Essentials does spin up "TypeScript Compiler" (this is the description string in the task manager, I suppose it is tsc.exe) when saving
  • Saving again before the compiling is done will spin up another "TypeScript Compiler" instance. There doesn't seem to be an upper limit. So pressing Ctrl-S five times in a row will spin up five compiler instances.
  • In situations where tsc.exe runs out of stack space, the "TypeScript Compiler" instance continues to exist and consume CPU (typically all of one core).
  • In situations where tsc.exe stops with an error, the error text is reflected into the generated JavaScript -- this is the correct behavior.
  • In situations where tsc.exe faults (but not due to stack overrun), the "TypeScript Compiler" instance no longer exists.
  • When editing code, the editor will halt after a few characters (after a short idle interval) and does a complete syntax check. I haven't observed tsc.exe being spun up during this check process so I am wrong in my previous comment. Sorry!
  • The syntax checking is quite slow, and doing it after each keystroke makes editing code a pain.

oisin wrote Jul 16, 2013 at 9:44 PM

It's not web essentials per-se causing the problem: see https://typescript.codeplex.com/discussions/450232

oisin wrote Jul 16, 2013 at 10:12 PM

getting back here again - I just re-read the whole comment thread. So it's web essentials that is spawning concurrent instances of TSC? If we enable compile-on-save via visual studio's plugin, this will not happen?

RyanCavanaugh wrote Aug 13, 2013 at 6:41 PM

That is correct; the VS plug-in does not spawn TSC to perform compile-on-save.

The other slowness is being addressed by bug fixes for the next release.