typelevel / typelevel/cats-effect
Use libunwind for tracing on Native
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 2.2k
- Forks
- 576
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 18
Description
In https://github.com/typelevel/cats-effect/pull/3195 I added tracing for Native based on the tried-and-true JVM/JS strategy of creating a Throwable and using its stack trace to introspect the call stack.
However, in Native we can explore using libunwind to directly introspect the stack without creating an exception. Furthermore, we could unwind only as far as we need (probably only 1 or 2 frames, to find the caller) instead of the entire stack. That might even mean that we don't need all the filtering jazz.
Ideally this should improve cold start performance (when traces are first generated and cached) or anyone using full tracing. It could also improve the performance of enhancing exceptions, if filtering stack traces was no longer necessary.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Scala Native unwind.scala implementation linked in the issue, then compare it with the Native tracing added in pull request 3195. Determine whether libunwind can replace Throwable-based stack inspection and limit unwinding to the needed frames; done means tracing and exception enhancement work with the intended performance improvement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- observability, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100