-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Report aggregate statistics for solution as well as some solution perf numbers #50267
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
Changes from 2 commits
fcba0ac
23470f3
fda1863
d727ca7
15cfd14
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,8 @@ namespace ts { | |
| export interface Performance { | ||
| mark(name: string): void; | ||
| measure(name: string, startMark?: string, endMark?: string): void; | ||
| clearMeasures(name?: string): void; | ||
| clearMarks(name?: string): void; | ||
| now(): number; | ||
| timeOrigin: number; | ||
| } | ||
|
|
@@ -50,6 +52,8 @@ namespace ts { | |
| typeof performance.mark === "function" && | ||
| typeof performance.measure === "function" && | ||
| typeof performance.now === "function" && | ||
| typeof performance.clearMarks === "function" && | ||
| typeof performance.clearMeasures === "function" && | ||
| typeof PerformanceObserver === "function"; | ||
| } | ||
|
|
||
|
|
@@ -73,8 +77,8 @@ namespace ts { | |
| try { | ||
| let performance: Performance; | ||
| const { performance: nodePerformance, PerformanceObserver } = require("perf_hooks") as typeof import("perf_hooks"); | ||
| if (hasRequiredAPI(nodePerformance, PerformanceObserver)) { | ||
| performance = nodePerformance; | ||
| if (hasRequiredAPI(nodePerformance as unknown as Performance, PerformanceObserver)) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this because our reference to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes its because of our There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason we shouldn't update our local copy of |
||
| performance = nodePerformance as unknown as Performance; | ||
| // There is a bug in Node's performance.measure prior to 12.16.3/13.13.0 that does not | ||
| // match the Web Performance API specification. Node's implementation did not allow | ||
| // optional `start` and `end` arguments for `performance.measure`. | ||
|
|
@@ -95,7 +99,9 @@ namespace ts { | |
| if (end === "__performance.measure-fix__") { | ||
| nodePerformance.clearMarks("__performance.measure-fix__"); | ||
| } | ||
| } | ||
| }, | ||
| clearMarks(name) { return nodePerformance.clearMarks(name); }, | ||
| clearMeasures(name) { return (nodePerformance as unknown as Performance).clearMeasures(name); }, | ||
| }; | ||
| } | ||
| return { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.