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

Emit time of the same incremental change differs in different scopes #14965

Closed
wclr opened this issue Apr 1, 2017 · 5 comments
Closed

Emit time of the same incremental change differs in different scopes #14965

wclr opened this issue Apr 1, 2017 · 5 comments
Labels
Duplicate An existing issue was already created

Comments

@wclr
Copy link

wclr commented Apr 1, 2017

TypeScript Version: 2.2.1

I have the following case:

tsc -w compiles and watches one folder X, and I change there one source file, incremental compilation diagnostics is:

Files:           90
Lines:        38318
Nodes:       165801
Identifiers:  58160
Symbols:      44386
Types:         1900
Memory used: 81376K
I/O read:     0.01s
I/O write:    0.04s
Parse time:   0.77s
Bind time:    0.00s
Check time:   0.14s
Emit time:    0.25s
Total time:   1.16s
11:32:24 AM - Compilation complete. Watching for file changes.

tsc -w has wider scope, compiles and watches the same folder X and also a few other folders with sources, diagnostics of the same operation (one file in the folder X changed)

Files:           246
Lines:         51949
Nodes:        211418
Identifiers:   72403
Symbols:       83205
Types:         15831
Memory used: 156732K
I/O read:      0.01s
I/O write:     0.13s
Parse time:    0.87s
Bind time:     0.01s
Check time:    1.35s
Emit time:     1.11s
Total time:    3.35s
11:32:26 AM - Compilation complete. Watching for f

Actually amount of file emitted (which is one file in the case) is (at least should be) the same in both cases, I wonder why Emit time: 1.11s differs so much (vs 0.25s in the first case) ? Not sure aslo why Check time (1.35s vs 0.14s) differs much too.

I have skipLibCheck and skipDefaultLibCheck disabled.

@wclr wclr changed the title Emit time of the same inremental change differs in different scopes Emit time of the same incremental change differs in different scopes Apr 1, 2017
@RyanCavanaugh
Copy link
Member

Without more details on this project it's impossible to say what's going on

@wclr
Copy link
Author

wclr commented Apr 3, 2017

Ok I have created test repo, where you you may see it I just took there big TS source for sample code:
https://github.com/whitecolor/ts-scope-emit-time

Clone it, run tsc -w --diagnostics

  1. in the root folder /
  2. in folder /1

Then change file /1/1.ts and see statistics:

  1. root:
Files:             70
Lines:         271850
Nodes:        2575790
Identifiers:  1214453
Symbols:       778521
Types:         413206
Memory used: 1215184K
I/O read:       0.00s
I/O write:      0.06s
Parse time:     0.05s
Bind time:      0.03s
Check time:     4.11s
Emit time:      4.97s
Total time:     9.16s
03:09:19 - Compilation complete. Watching for file changes.
Files:             2
Lines:         23106
Nodes:        115210
Identifiers:   44105
Symbols:       31541
Types:         10986
Memory used: 160984K
I/O read:      0.00s
I/O write:     0.00s
Parse time:    0.05s
Bind time:     0.03s
Check time:    0.34s
Emit time:     0.12s
Total time:    0.55s

So we changed just 1 file and emited only changes of it in both cases, but time is drastically different.

@wclr
Copy link
Author

wclr commented Apr 10, 2017

@RyanCavanaugh haven't you check example? Interested in comments on this issue.

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label May 24, 2017
@wclr
Copy link
Author

wclr commented Jun 13, 2017

@RyanCavanaugh @mhegazy

I just wonder if something is going to improve in this area of TS, when we have well not so big code base that is watched, but an incremental compilation of one changed file takes the more time the more this codebase is, tough it is only one small change.

@mhegazy
Copy link
Contributor

mhegazy commented Jun 13, 2017

the number of files are different. tsc --watch does not do any optimization at the moment, it will emit all files on a change, so the emit time is a function of the number of input files. #10879 tracks optimizing it.

@mhegazy mhegazy closed this as completed Jun 13, 2017
@mhegazy mhegazy added Duplicate An existing issue was already created and removed Needs Investigation This issue needs a team member to investigate its status. labels Jun 13, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants