{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13057","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13057/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13057/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13057/events","html_url":"https://github.com/Microsoft/TypeScript/issues/13057","id":196707531,"number":13057,"title":"Diagnostics for costly type inference","user":{"login":"pspeter3","id":607701,"avatar_url":"https://avatars.githubusercontent.com/u/607701?v=3","gravatar_id":"","url":"https://api.github.com/users/pspeter3","html_url":"https://github.com/pspeter3","followers_url":"https://api.github.com/users/pspeter3/followers","following_url":"https://api.github.com/users/pspeter3/following{/other_user}","gists_url":"https://api.github.com/users/pspeter3/gists{/gist_id}","starred_url":"https://api.github.com/users/pspeter3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pspeter3/subscriptions","organizations_url":"https://api.github.com/users/pspeter3/orgs","repos_url":"https://api.github.com/users/pspeter3/repos","events_url":"https://api.github.com/users/pspeter3/events{/privacy}","received_events_url":"https://api.github.com/users/pspeter3/received_events","type":"User","site_admin":false},"labels":[{"id":113971304,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Needs%20More%20Info","name":"Needs More Info","color":"556b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-20T15:52:36Z","updated_at":"2016-12-22T07:46:13Z","closed_at":null,"body":"**TypeScript Version:**  2.1.1 / nightly (2.2.0-dev.201xxxxx)\r\n\r\nAs described in http://stackoverflow.com/questions/36624273/investigating-long-typescript-compile-times, untyped generics can cause the TypeScript compiler to spend significantly more time type checking. It would be extremely useful to have the diagnostics report expensive type inference.\r\n\r\n**Code**\r\n\r\nThis is copied from the StackOverflow example\r\n\r\n```ts\r\n// slow:\r\n// ...\r\n.flatMap((receivedObj: MyType) => {\r\n    let nextObservable: Observable<MySecondType> = this.dependingPut(receivedObj);\r\n    return nextObservable || new Observable((observer) => {\r\n            observer.next(undefined);\r\n        });\r\n});\r\n\r\n\r\n// fast:\r\n.flatMap((receivedObj: MyType) => {\r\n    let nextObservable: Observable<MySecondType> = this.dependingPut(receivedObj);  \r\n    return nextObservable || new Observable<MySecondType>((observer) => { // <--- use the generics!\r\n            observer.next(undefined);\r\n        });\r\n});\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nDisplay costly type inference when diagnostics mode is enabled. Running `git bisect` to find performance bottlenecks is prohibitively difficult with a significantly large code base.\r\n\r\n**Actual behavior:**\r\n\r\nOnly time checking is reported when using the diagnostics flag."},"comment":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/comments/268739127","html_url":"https://github.com/Microsoft/TypeScript/issues/13057#issuecomment-268739127","issue_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/13057","id":268739127,"user":{"login":"HerringtonDarkholme","id":2883231,"avatar_url":"https://avatars.githubusercontent.com/u/2883231?v=3","gravatar_id":"","url":"https://api.github.com/users/HerringtonDarkholme","html_url":"https://github.com/HerringtonDarkholme","followers_url":"https://api.github.com/users/HerringtonDarkholme/followers","following_url":"https://api.github.com/users/HerringtonDarkholme/following{/other_user}","gists_url":"https://api.github.com/users/HerringtonDarkholme/gists{/gist_id}","starred_url":"https://api.github.com/users/HerringtonDarkholme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HerringtonDarkholme/subscriptions","organizations_url":"https://api.github.com/users/HerringtonDarkholme/orgs","repos_url":"https://api.github.com/users/HerringtonDarkholme/repos","events_url":"https://api.github.com/users/HerringtonDarkholme/events{/privacy}","received_events_url":"https://api.github.com/users/HerringtonDarkholme/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T07:46:13Z","updated_at":"2016-12-22T07:46:13Z","body":"IMHO, as an end user, I just want to know which line of code/function cost most time.  So maybe compiler can just collect time spent on `checkSourceElement` / `checkDeferredNode` for each node?"}}
{"actor":{"display_login":"HerringtonDarkholme"}}