Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture stacktrace on SameThreadVerifier creation #116

Open
lukaville opened this issue Oct 14, 2019 · 2 comments
Open

Capture stacktrace on SameThreadVerifier creation #116

lukaville opened this issue Oct 14, 2019 · 2 comments

Comments

@lukaville
Copy link
Contributor

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.

@arkivanov
Copy link
Contributor

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

@lukaville
Copy link
Contributor Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants