File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Sources/CodeEditTextView/TextLayoutManager Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -168,8 +168,13 @@ public class TextLayoutManager: NSObject {
168
168
let end = mach_absolute_time ( )
169
169
let elapsed = end - start
170
170
let nanos = elapsed * UInt64( info. numer) / UInt64( info. denom)
171
- let msec = TimeInterval ( nanos) / TimeInterval( NSEC_PER_MSEC)
172
- logger. info ( " TextLayoutManager built in: \( msec, privacy: . public) ms " )
171
+ let sec = TimeInterval ( nanos) / TimeInterval( NSEC_PER_SEC)
172
+ // This used to be logged every time. However we're now confident enough in the performance of this method
173
+ // that it's not useful to log it anymore unless it's an odd number. Taking ~500ms for a >500k loc file
174
+ // is normal. More than 1s for any document is not normal.
175
+ if sec >= 1 {
176
+ logger. warning ( " TextLayoutManager built in: \( sec, privacy: . public) s " )
177
+ }
173
178
#endif
174
179
}
175
180
You can’t perform that action at this time.
0 commit comments