MVICore icon indicating copy to clipboard operation
MVICore copied to clipboard

Capture stacktrace on SameThreadVerifier creation

Open lukaville opened this issue 6 years ago • 2 comments

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 avatar Oct 14 '19 10:10 lukaville

@lukaville Capturing stack trace is quite slow operation, might affect performance. Specially if you create a complex screen with lots of features.

arkivanov avatar Dec 10 '19 14:12 arkivanov

@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

lukaville avatar Dec 13 '19 17:12 lukaville