MVICore
MVICore copied to clipboard
Capture stacktrace on SameThreadVerifier creation
If SameThreadVerifier is enabled we can capture stack trace where this object was created and then print it on assertion error (or add it as a cause). It should help with debugging such errors.
@lukaville Capturing stack trace is quite slow operation, might affect performance. Specially if you create a complex screen with lots of features.
@arkivanov
Checked stacktrace capturing benchmark on Galaxy S7 edge:
@Test
fun stacktraceCapturing() {
benchmarkRule.measureRepeated {
Thread.currentThread().stackTrace
}
}
It was constantly around ~60 ns, so I don't think it's an issue.
benchmark: 62,110 ns stacktraceCapturing
benchmark: 59,670 ns stacktraceCapturing
benchmark: 57,835 ns stacktraceCapturing
benchmark: 57,835 ns stacktraceCapturing
benchmark: 61,538 ns stacktraceCapturing