We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87a7112 commit 16cef4aCopy full SHA for 16cef4a
src/compiler/sys.ts
@@ -1859,12 +1859,19 @@ namespace ts {
1859
}
1860
1861
function getModifiedTime(path: string) {
1862
+ // Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve
1863
+ // the CPU time performance.
1864
+ const originalStackTraceLimit = Error.stackTraceLimit;
1865
+ Error.stackTraceLimit = 0;
1866
try {
1867
return statSync(path)?.mtime;
1868
1869
catch (e) {
1870
return undefined;
1871
1872
+ finally {
1873
+ Error.stackTraceLimit = originalStackTraceLimit;
1874
+ }
1875
1876
1877
function setModifiedTime(path: string, time: Date) {
0 commit comments