Fix performance issue for case when there are a lot of warnings in file
There was a problem with `reportDiagnosticOnce` method which was called, for example, to report diagnostics about experimentalities. It was crucial for code as in the issue (KT-34204). The whole complexity was "count of experimental diagnostics" multiply "count of all diagnostics" multiply very large constant. Almost on each `reportDiagnosticOnce` method `readonlyView()` was called which in turn called computation of cache. During cache computation we were iterating through the all diagnostics and also were using KotlinSuppressCache, which is not very fast. #KT-34204 Fixed
This commit is contained in:
@@ -336,6 +336,9 @@ private class LazyJvmDiagnostics(compute: () -> Diagnostics) : Diagnostics {
|
||||
|
||||
override fun noSuppression() = delegate.noSuppression()
|
||||
|
||||
override fun hasDiagnostic(diagnostic: Diagnostic) =
|
||||
delegate.hasDiagnostic(diagnostic)
|
||||
|
||||
override fun iterator() = delegate.iterator()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user