Skip to content

Releases: typelevel/cats-effect

v3.6.1

07 Apr 22:01
e3c932a
Compare
Choose a tag to compare

This is the fifty-sixth release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and fully source-compatible with the 3.6.x lineage. Please note that we did break binary compatibility with 3.6.0 RC1 (not with 3.5.x) in order to fix some things, so if you published anything against that release you will need to reconsider your life choices.

Warning

Please note that Cats Effect 3.6.x is targeting Scala Native 0.4.x, which means it does not at present support native multithreading. This was a very intentional choice meant to give us an opportunity to break binary compatibility only on Scala Native if necessary when upgrading to Scala Native 0.5 and as we discover the impacts of the integrated runtime on the downstream ecosystem. It also reduces risk since Native multithreading in the runtime is a significant lift and we want to make sure we isolate that change from the already significant changes in 3.6.0. This functionality has already merged into the development branch and we plan to release it in 3.7.0 as soon as possible.

What's Changed

Bug Fixes

Documentation

Behind the Scenes

New Contributors

Full Changelog: v3.6.0...v3.6.1

v3.6.0

23 Mar 17:54
f0db44d
Compare
Choose a tag to compare

This is the fifty-fifth release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and fully source-compatible with the 3.6.x lineage. Please note that we did break binary compatibility with 3.6.0 RC1 (not with 3.5.x) in order to fix some things, so if you published anything against that release you will need to reconsider your life choices.

Warning

Please note that Cats Effect 3.6.x is targeting Scala Native 0.4.x, which means it does not at present support native multithreading. This was a very intentional choice meant to give us an opportunity to break binary compatibility only on Scala Native if necessary when upgrading to Scala Native 0.5 and as we discover the impacts of the integrated runtime on the downstream ecosystem. It also reduces risk since Native multithreading in the runtime is a significant lift and we want to make sure we isolate that change from the already significant changes in 3.6.0. This functionality is already under development and we plan to release it in 3.7.0 as soon as possible.

What's Changed

This release contains the largest change to the Cats Effect internal work scheduler since the introduction of work stealing back in the run up to 3.0.0. In particular, we have finally completed implementation of the integrated runtime we first conceived of back in early 2022. Well, I say "we", but really @armanbilge deserves the absolute lion's share of the credit here. He did almost all of the work not only on the direct implementation in Cats Effect, but also the downstream functionality built on top of it in Fs2 and in Http4sโ€ฆ not only on the JVM but also in Scala Native and across multiple operating systems! It is hard to overstate how gargantuan of an effort this was, both in design and implementation.

As immense as the effort has been, the impact is even more dramatic. We've already observed scenarios in which the performance of microservices implemented on top of Http4s Ember on the JVM leveraging io_uring is improved by over 3.5x! That is to say, the performance is 3.5x higher than baseline using classical NIO2! (as measured by TechEmpower, suggesting performance more than 2x higher than pekko-http) Now, TechEmpower does have its limitations as a framework, but it does represent a useful standard candle for certain access patterns, and improving an already very fast trio of frameworks by this magnitude is not something that happens every day. Even more excitingly, this is just the tip of the iceberg! We ran these tests with very early, almost PoC code with a lot of performance-impacting caveats. The best is yet to come.

And if that wasn't enough, the biggest impacts are not on the JVM but actually on Scala Native. Without diving too far into the details, this type of syscall scheduling mechanism is exactly what is necessary on Scala Native to achieve any measure of performance from downstream services. It is actually remarkably similar to what the Go runtime does, though implemented in a more extensible way (e.g. Go does not, at present, have native support for io_uring, whereas Cats Effect can and has implemented this via a third-party library).

Going forward, Cats Effect will be maintaining support for the following polling systems:

  • JVM
    • Selector
  • Native
    • kqueue
    • epoll

Support for io_uring is already under heavy development, and we expect to incorporate this into Cats Effect at some future date, supporting both Native and JVM. The integrated runtime was specifically designed with io_uring's unique data patterns in mind and we have already been able to demonstrate that downstream layers of the ecosystem will be able to fully leverage its benefits. Additionally, we believe we can meaningfully improve JVM performance by implementing epoll and kqueue support for the JVM (and not just Native), the former for situations where io_uring is unavailable. This is mostly because Selector is actually very very slow, and while the performance of the Selector-based runtime is roughly on par with what we've been able to achieve on top of NIO2 (which has its own syscall management and is incompatible with the integrated runtime), we know we can do quite a bit better.

On top of the above, this release contains a large number of other enhancements covering a number of major scenarios. Most noticeably, thanks to @kamilkloch, explicitly importing cats.syntax.all._ is no longer required for most usage involving explicit IO! You will still need the syntax import for any use of parametric effects (commonly referred to as "tagless final" or F[_]), and unfortunately due to the way Scala's type inference works, it is also required for the very common traverse function, but nearly any and all other cases have had their implicit search tweaked to avoid this inconvenience. This in turn means that . completion now mostly Just Worksโ„ข when using IO (and when it doesn't, hunting for methods on the IO companion object definitely works).

An additional class of work went into substantially improving the internal instrumentation and metrics associated with the runtime. As previously, these are all exposed as JMX MBeans on the JVM, but we have additionally added public APIs which allow applications to self-instrument (rather than forcing external untyped instrumentation via JMX). These metrics have been organized to mirror the structure of the runtime itself and can all be found within the cats.effect.unsafe.metrics package.

If you're an end-user of Cats Effect (in other words, you run applications built on Cats Effect, rather than building libraries or frameworks), one way you can very much aid the future development of the library is to incorporate these metrics (likely via JMX) into your application observability and key metrics. This should allow you to start to build up an intuition for what metrics are significant indicators of good or bad or just plain normal behavior. This is exactly the type of information that is difficult for library authors to realistically determine, but if end-users learn this on our behalf, you can help educate us on the precise details of how the runtime behaves for your application in your production context, shaping the future optimization and tuning of the framework! (note: Cats Effect does not proactively send metrics anywhere from your application, it merely exposes them to your own monitoring infrastructure)

Enhancements

Read more

v3.6.0-RC2

28 Feb 02:26
712d37f
Compare
Choose a tag to compare
v3.6.0-RC2 Pre-release
Pre-release

This is the fifty-fourth release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and expected to be fully source-compatible with the eventual 3.6.x lineage. However, we did break binary-compatibility with the previous candidate v3.6.0-RC1.

This release candidate is expected to be very stable, and our main rationale for releasing it as such rather than as a full 3.6.0 is to allow the ecosystem (and adventurous end users!) to try it out and find unforeseen problems prior to full release. If fixing those problems require breaking compatibility prior to 3.6.0 (while maintaining bincompat with 3.x) we will do so, but otherwise you should expect this release to roughly represent the exact API surface area we will ultimately release.

Warning

Please note that Cats Effect 3.6.x is targeting Scala Native 0.4.x, which means it does not at present support native multithreading. This was a very intentional choice meant to give us an opportunity to break binary compatibility only on Scala Native if necessary when upgrading to Scala Native 0.5 and as we discover the impacts of the integrated runtime on the downstream ecosystem. It also reduces risk since Native multithreading in the runtime is a significant lift and we want to make sure we isolate that change from the already significant changes in 3.6.0. This functionality is already under development and we plan to release it in 3.7.0 as soon as possible.

What's Changed

Enhancements

Bug Fixes

Documentation

Behind the Scenes

New Contributors

Full Changelog: v3.6.0-RC1...v3.6.0-RC2

v3.6.0-RC1

28 Dec 00:30
v3.6.0-RC1
adb0449
Compare
Choose a tag to compare
v3.6.0-RC1 Pre-release
Pre-release

This is the fifty-third release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and expected to be fully source-compatible with the eventual 3.6.x lineage.

This release candidate is expected to be very stable, and our main rationale for releasing it as such rather than as a full 3.6.0 is to allow the ecosystem (and adventurous end users!) to try it out and find unforeseen problems prior to full release. If fixing those problems require breaking compatibility prior to 3.6.0 (while maintaining bincompat with 3.x) we will do so, but otherwise you should expect this release to roughly represent the exact API surface area we will ultimately release.

Warning

Please note that Cats Effect 3.6.x is targeting Scala Native 0.4.x, which means it does not at present support native multithreading. This was a very intentional choice meant to give us an opportunity to break binary compatibility only on Scala Native if necessary when upgrading to Scala Native 0.5 and as we discover the impacts of the integrated runtime on the downstream ecosystem. It also reduces risk since Native multithreading in the runtime is a significant lift and we want to make sure we isolate that change from the already significant changes in 3.6.0. This functionality is already under development and we plan to release it in 3.7.0 as soon as possible.

What's Changed

This release contains the largest change to the Cats Effect internal work scheduler since the introduction of work stealing back in the run up to 3.0.0. In particular, we have finally completed implementation of the integrated runtime we first conceived of back in early 2022. Well, I say "we", but really @armanbilge deserves the absolute lion's share of the credit here. He did almost all of the work not only on the direct implementation in Cats Effect, but also the downstream functionality built on top of it in Fs2 and in Http4sโ€ฆ not only on the JVM but also in Scala Native and across multiple operating systems! It is hard to overstate how gargantuan of an effort this was, both in design and implementation.

As immense as the effort has been, the impact is even more dramatic. We've already observed scenarios in which the performance of microservices implemented on top of Http4s Ember on the JVM leveraging io_uring is improved by over 3.5x! That is to say, the performance is 3.5x higher than baseline using classical NIO2! (as measured by TechEmpower, suggesting performance more than 2x higher than pekko-http) Now, TechEmpower does have its limitations as a framework, but it does represent a useful standard candle for certain access patterns, and improving an already very fast trio of frameworks by this magnitude is not something that happens every day. Even more excitingly, this is just the tip of the iceberg! We ran these tests with very early, almost PoC code with a lot of performance-impacting caveats. The best is yet to come.

And if that wasn't enough, the biggest impacts are not on the JVM but actually on Scala Native. Without diving too far into the details, this type of syscall scheduling mechanism is exactly what is necessary on Scala Native to achieve any measure of performance from downstream services. It is actually remarkably similar to what the Go runtime does, though implemented in a more extensible way (e.g. Go does not, at present, have native support for io_uring, whereas Cats Effect can and has implemented this via a third-party library).

Going forward, Cats Effect will be maintaining support for the following polling systems:

  • JVM
    • Selector
  • Native
    • kqueue
    • epoll

Support for io_uring is already under heavy development, and we expect to incorporate this into Cats Effect at some future date, supporting both Native and JVM. The integrated runtime was specifically designed with io_uring's unique data patterns in mind and we have already been able to demonstrate that downstream layers of the ecosystem will be able to fully leverage its benefits. Additionally, we believe we can meaningfully improve JVM performance by implementing epoll and kqueue support for the JVM (and not just Native), the former for situations where io_uring is unavailable. This is mostly because Selector is actually very very slow, and while the performance of the Selector-based runtime is roughly on par with what we've been able to achieve on top of NIO2 (which has its own syscall management and is incompatible with the integrated runtime), we know we can do quite a bit better.

On top of the above, this release contains a large number of other enhancements covering a number of major scenarios. Most noticeably, thanks to @kamilkloch, explicitly importing cats.syntax.all._ is no longer required for most usage involving explicit IO! You will still need the syntax import for any use of parametric effects (commonly referred to as "tagless final" or F[_]), and unfortunately due to the way Scala's type inference works, it is also required for the very common traverse function, but nearly any and all other cases have had their implicit search tweaked to avoid this inconvenience. This in turn means that . completion now mostly Just Worksโ„ข when using IO (and when it doesn't, hunting for methods on the IO companion object definitely works).

An additional class of work went into substantially improving the internal instrumentation and metrics associated with the runtime. As previously, these are all exposed as JMX MBeans on the JVM, but we have additionally added public APIs which allow applications to self-instrument (rather than forcing external untyped instrumentation via JMX). These metrics have been organized to mirror the structure of the runtime itself and can all be found within the cats.effect.unsafe.metrics package.

If you're an end-user of Cats Effect (in other words, you run applications built on Cats Effect, rather than building libraries or frameworks), one way you can very much aid the future development of the library is to incorporate these metrics (likely via JMX) into your application observability and key metrics. This should allow you to start to build up an intuition for what metrics are significant indicators of good or bad or just plain normal behavior. This is exactly the type of information that is difficult for library authors to realistically determine, but if end-users learn this on our behalf, you can help educate us on the precise details of how the runtime behaves for your application in your production context, shaping the future optimization and tuning of the framework! (note: Cats Effect does not proactively send metrics anywhere from your application, it merely exposes them to your own monitoring infrastructure)

Enhancements

Read more

v3.5.7

25 Nov 18:11
58a54e8
Compare
Choose a tag to compare

This is the fifty-second release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and fully source-compatible with every 3.5.x release.

Warning

The 3.5.x series contains some changes that may be semantically breaking with respect to earlier 3.x releases. If you're using fs2, http4s, or other libraries from the ecosystem, make sure you've upgraded to versions of these libraries that are compatible with this release (for fs2, that's 3.7.0+, for http4s it's 0.23.19+)!

Additionally, if you're using methods like fromFuture, make sure you're aware of the major changes to async, described in these release notes.

What's Changed

Enhancements

  • Propagate Java thread interruption in Dispatcher#unsafeRunSync by @kamilkloch in #4167

Behind the Scenes

Full Changelog: v3.5.6...v3.5.7

v3.5.6

19 Nov 18:00
98b175b
Compare
Choose a tag to compare

This is the fifty-first release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and fully source-compatible with every 3.5.x release.

Warning

The 3.5.x series contains some changes that may be semantically breaking with respect to earlier 3.x releases. If you're using fs2, http4s, or other libraries from the ecosystem, make sure you've upgraded to versions of these libraries that are compatible with this release (for fs2, that's 3.7.0+, for http4s it's 0.23.19+)!

Additionally, if you're using methods like fromFuture, make sure you're aware of the major changes to async, described in these release notes.

What's Changed

Enhancements

  • Only remove error callback if we've added it by @durban in #4168

Bug Fixes

Documentation

Behind the Scenes

Full Changelog: v3.5.5...v3.5.6

v3.5.5

27 Oct 19:24
d241856
Compare
Choose a tag to compare

This is the fiftieth release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and fully source-compatible with every 3.5.x release.

Warning

The 3.5.x series contains some changes that may be semantically breaking with respect to earlier 3.x releases. If you're using fs2, http4s, or other libraries from the ecosystem, make sure you've upgraded to versions of these libraries that are compatible with this release (for fs2, that's 3.7.0+, for http4s it's 0.23.19+)!

Additionally, if you're using methods like fromFuture, make sure you're aware of the major changes to async, described in these release notes.

What's Changed

Enhancements

Bug Fixes

  • Fix #4066: shut down executors when IORuntime.global shuts down by @durban in #4067
  • Use IOApp#reportFailure instead of printStackTrace() for blocking EC by @fredfp in #4044
  • Fix cancelable to guarantee cancelation by @armanbilge in #4118

Documentation

Behind the Scenes

New Contributors

Full Changelog: v3.5.4...v3.5.5

v3.5.4

05 Mar 21:45
4fc5628
Compare
Choose a tag to compare

This is the forty-ninth release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and fully source-compatible with every 3.5.x release.

Warning

The 3.5.x series contains some changes that may be semantically breaking with respect to earlier 3.x releases. If you're using fs2, http4s, or other libraries from the ecosystem, make sure you've upgraded to versions of these libraries that are compatible with this release (for fs2, that's 3.7.0+, for http4s it's 0.23.19+)!

Additionally, if you're using methods like fromFuture, make sure you're aware of the major changes to async, described in these release notes.

What's Changed

The most significant change in this release involves the complete greenfield rewrite of Dispatcher. While Dispatcher is, in practice, one of the most-used components of Cats Effect apart from IO itself, it is also one of the oldest and most "accreted" parts of the codebase. The original variant of Dispatcher had far fewer features and was thrown together relatively quickly during the 3.0 milestone process, and every change and enhancement to its functionality has been layered on top of that foundation.

In this release, we started with an empty editor buffer and rebuilt the whole thing, taking the opportunity to correct a number of corner cases in semantics while significantly beefing up the test suite. We're very confident that the results are much more stable and reliable than the previous iteration, and we're excited to get it into everyone's hands!

Enhancements

  • IORuntimeConfig: reject invalid auto-yield and cancelation check thresholds by @durban in #3987
  • Rewrote Dispatcher by @djspiewak in #3923

Bug Fixes

Documentation

  • Fix typos in Async scaladoc by @durban in #3995
  • Removes language:postfixOps from tutorial as it is not used. by @froth in #4025

Behind the Scenes

New Contributors

Full Changelog: v3.5.3...v3.5.4

v3.5.3

15 Jan 22:37
d246e7f
Compare
Choose a tag to compare

This is the forty-eighth release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and fully source-compatible with every 3.5.x release.

Warning

The 3.5.x series contains some changes that may be semantically breaking with respect to earlier 3.x releases. If you're using fs2, http4s, or other libraries from the ecosystem, make sure you've upgraded to versions of these libraries that are compatible with this release (for fs2, that's 3.7.0+, for http4s it's 0.23.19+)!

Additionally, if you're using methods like fromFuture, make sure you're aware of the major changes to async, described in these release notes.

What's Changed

Enhancements

Bug Fixes

Documentation

Behind the Scenes

New Contributors

Full Changelog: v3.5.2...v3.5.3

v3.5.2

27 Sep 22:36
2637a5e
Compare
Choose a tag to compare

This is the forty-seventh release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and fully source-compatible with every 3.5.x release.

โš ๏ธ Important note

The 3.5.x series contains some changes that may be semantically breaking with respect to earlier 3.x releases. If you're using fs2, http4s, or other libraries from the ecosystem, make sure you've upgraded to versions of these libraries that are compatible with this release (for fs2, that's 3.7.0+, for http4s it's 0.23.19+)!

Additionally, if you're using methods like fromFuture, make sure you're aware of the major changes to async, described in these release notes.

What's Changed

Features

Bug Fixes

  • Fix Hotswap#get being blocked by Hotswap#swap by @forkedcancel in #3800
  • Acquire exclusive lock before finalizing Hotswap by @armanbilge in #3841

Behind the Scenes

Documentation

New Contributors

Full Changelog: v3.5.1...v3.5.2