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
Debuggable IO [DIO] #849
Debuggable IO [DIO] #849
Conversation
…or better traces, add a traceEffects switch
…fail in raceBoth & raceAttempt; Add AsmTracer vs. AkkaTracer benchmar; Add IODeepLeftBindBenchmark
…al/With continuation if effect failed
@Kaishh congrats! impressive work! Is https://github.com/lihaoyi/sourcecode not used to avoid adding macros to the project? |
@iravid that, and compile-time solutions cannot provide support for 3rd-party libraries, like doobie, http4s and existing code written with tagless final so we decided to go with the other way |
Cool, did not consider that! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
benchmarks/src/main/scala/scalaz/zio/stacktracer/impls/AsmTracer.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing work and going to be hugely helpful to real world programmers!
I have a few suggestions, my only main concern is the inescapable overhead with the wrapping (ZioFn
, & friends) and maintainability overhead. Beyond that, I think the main thing I would like to see is having the tracing logic pulled out of FiberContext to simplify reasoning about the core interpreter (which can then just call into the logic class to do the heavy lifting). If you could take a crack at the easy stuff now, then we can get this merged in and deal with other issues over the coming weeks, maybe with help from other contributors.
core/shared/src/main/scala/scalaz/zio/internal/FiberContext.scala
Outdated
Show resolved
Hide resolved
…ature/zio-stacktraces
…ature/zio-stacktraces
@jdegoes
|
? |
Final benchmarks (on a mid-tier xeon): enabled tracing:
disabled tracing:
cats-effect IO:
Tracing overhead: ~2.3x ; ~1.6x vs cats. |
@Kaishh This looks great. Can't wait to use it. It would be nice selling point to see example traces. So that people know they're not stacktraces they know and (don't) love :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superb! There's more work to do, but a lot of people are waiting on this, so let's get it merged in, and we can deal with remaining issues separately.
🎉 |
finally!! |
* ZIO POC #1 * Add Fiber Ancestry trace * noticket comment mutable Spec * Decorate Exit.Cause with traces on Fail in RTS * Exclude Exit.Cause.trace field from equals/hashCode (???) * wrap ZIO.const * Fail now takes a stack trace gen * Add Refail and decorate foreachPar/racePar APIs with it * fixup trace for `blocking.blocking`, reduce uses for ZIO.identityFn for better traces, add a traceEffects switch * Obey Platform-level TracingConfig. unblock scala.js version. * re-enable inlining by fixing typo in scalac options * enable inlining for `internal` package only (interferes with traces) * Add inheritable tracing regions. Craft .bracket* traces, optimize global cache * cache reflection failuires; .intern() strings after substitutions; refail in raceBoth & raceAttempt; Add AsmTracer vs. AkkaTracer benchmar; Add IODeepLeftBindBenchmark * refactor ZTrace printing; always show FiberId; do not trace EffectTotal/With continuation if effect failed * Always mention Execution trace / stack trace in ZTrace pretty print, even if empty. * Use must_=== instead of throwA to ignore traces in test equality * Move stacktraces spec to 2.12+ only * Add Akka licence notice, move global cache under Tracer object * fix imports * ringbuffer fixed * cleanups * scalafmt * Extend StacktracesSpec; put future trace on top in pretty print; remove FiberAncestry class; * Fix stack traces for FlatMap's Effect* happy path; extend suite with regressions * Add lambda wrapping for folM, catchAll and catchSome * remove duplicate interrupt tests in RTSSpec * Repalce Refail and trace fields with Cause.Traced! * merge fixes * traceExec/Stack as vals in FiberContext * Pack tracing fields in Platform into Tracing case class * fmt * add newlines between ring buffer fields * remove comment in AsmTracer * fix TwitterSpec * add lambda wrapping for fold/tapError/mapError/bimap/tapBothorElse/zipWith * fmt * restrict StacktracesSpec to 2.12-2.13 only (no dotty) * increase timeouts in ZManagedSpec as a workaround (should use latches) * fmt * reposition sleep in TwitterSpec * unused import * tweak TwitterSpec * Symmetric equals for Cause.Traced * AkkaTracer -> AkkaLineNumbersTracer * remove null in Js.PlatformLive * remove dead code & add apache licence headers * post-merge fixup * Add CheckTracing * optimize recordTrace * add final * add pushContinuation
@goral09 Here's also an example trace from fs2 from ZIO test suite:
|
ZIO Tracing's True Power, as its name suggests, is to reign supreme over the entire world!