Releases: zio/zio-query
v0.7.6
This tiny release improves interop with ZIO
effects by adding the following methods to the ZQuery
API: catchAllZIO
, catchAllCauseZIO
, foldZIO
, and foldCauseZIO
.
What's Changed
- Update README.md by @zio-assistant in #508
- Enrich and optimize error handling API by @kyri-petrou in #509
- Update ZIO version by @kyri-petrou in #510
Full Changelog: v0.7.5...v0.7.6
v0.7.5
This tiny release adds support for Scala Native and optimizes the performance of datasource-backed queries
What's Changed
- Optimize execution of datasource-backed ZQueries by @kyri-petrou in #501
- Update README.md by @zio-assistant in #502
- Scala Native support by @kyri-petrou in #503
- Add Scala Native to project aggregates by @kyri-petrou in #504
- Update ZIO and enable multi-threading for Scala Native by @kyri-petrou in #505
- Use separate CI job to check website build by @kyri-petrou in #506
- Optimize init and restoration of
FiberRefs
when running queries by @kyri-petrou in #507
Full Changelog: v0.7.4...v0.7.5
v0.7.4
This minor release contains performance improvements for short-lived queries, but more importantly, queries that heavily utilize ZQuery.fromRequest
. It is also fully binary compatible with the v0.7.x series.
What's Changed
- Improve performance of
ZQuery#run
by @kyri-petrou in #497 - Update README.md by @zio-assistant in #498
- Use a single
FiberRef
for retrieving the Cache and identifying disabled caching by @kyri-petrou in #495 - Make
ZQuery#run
reentrant safe by @kyri-petrou in #499
Full Changelog: v0.7.3...v0.7.4
v0.7.3
This very minor release contains performance optimizations for queries that rely heavily on deduplication of requests.
And it is fully binary and source compatible with the v0.7.x series!
Highlights
- Avoid unnecessary creation of
Both
/Then
whenBlockedRequests == Empty
by @kyri-petrou in #494
Other changes
- Update CI and plugin versions by @kyri-petrou in #492
- Update README.md by @zio-assistant in #493
Full Changelog: v0.7.2...v0.7.3
v0.7.2
This minor release adds new eager ZQuery.*Now
constructors (e.g., ZQuery.succeedNow
) that allow users to lift pure values into a ZQuery. Eagerly constructed queries allow for more aggressive under-the-hood optimizations at the cost of not capturing side-effects. As such, they should only ever be used for lifting pure values, and never in recursive methods!
Highlights
- Allow queries to be eagerly constructed by @kyri-petrou in #488
Other changes
- Bump zio & other deps by @kyri-petrou in #484
- Update README.md by @zio-assistant in #485
- Update zio to 2.1.1 by @kyri-petrou in #486
- Update ZIO version by @kyri-petrou in #487
- Make methods on ZQuery non-final by @kyri-petrou in #489
- Remove unused type param from
Cache#lookup
by @kyri-petrou in #490
Full Changelog: v0.7.1...v0.7.2
v0.7.1
This release brings some new constructors and methods that extend ZQuery
's functionality as well as some minor performance improvements.
Highlights
- New query constructors and method aliases by @kyri-petrou in #480
- Add method to memoize the result of a ZQuery by @kyri-petrou in #481
Other changes
- Re-enable MiMa and set
versionScheme
toearly-semver
by @kyri-petrou in #477 - Update README.md by @zio-assistant in #478
- Update benchmarking results for v0.7.0 by @kyri-petrou in #479
- Avoid unnecessary flatmaps in various methods by @kyri-petrou in #482
- Update sbt to 1.10 by @kyri-petrou in #483
Full Changelog: v0.7.0...v0.7.1
v0.7.0
Release Notes
This release focuses heavily on improving the performance of query execution for DataSource-backed queries. Applications that heavily rely on ZQuery.fromRequest
for batching a large number of requests should see a notable improvement in performance. In v0.6.x, batching of ~1,000 unique requests to a single datasource would take approximately 1ms of CPU time according to our benchmarks. With this new release, batching of the same number of requests takes ~200-250us (~x4-5 improvement) 🚀
New additions
- Added multiple new constructor methods for
CompletedRequestMap
s. If your code relies on creating customDataSource
s, make sure to check them out! (see section below for more info) - Added an overload to
Cache.empty
that allows pre-sizing the underlying cache. This can improve performance in cases where there are a large number of requests
Deprecations
In order to improve performance as much as possible, the internals of Cache
and CompletedRequestMap
were re-written to utilize mutable data structures, which offer much better performance than immutable ones. In order to avoid mutability leaking into existing user's code, the ++
, insert
and insertOption
on CompletedRequestMap
remain immutable but have been deprecated as they'll lead to sub-optimal performance.
Users that construct DataSource
and CompletedRequestMap
manually, should migrate their existing code to use one of the many new constructors added in the CompletedRequestMap
companion object instead. See below for some migration examples:
Single request:
val request = ???
// v0.6.x
CompletedRequestMap.empty.insert(request, Exit.succeed(value))
// v0.7.0
CompletedRequestMap.single(request, Exit.succeed(value))
Iterable of (request, value)
:
case class GetId(id: UUID) extends Request[Nothing, GetId]
case class Response(value: String)
val keysAndValues: List[(UUID, String)] = ???
// v0.6.x
keysAndValues.foldLeft(CompletedRequestMap.empty) { case (map, (k, v)) => map.insert(GetId(k), Response(v)) }
// v0.7.0
CompletedRequestMap.fromIterableWith(keysAndValues)(kv => GetId(kv._1), kv => Response(kv._2))
All changes
- Optimize Datasource-based queries by @kyri-petrou in #467
- Update README.md by @zio-assistant in #468
- Unify
ZQuery.foreach
implementations and cleanups by @kyri-petrou in #469 - Optimize
CompletedRequestMap
by @kyri-petrou in #470 - Use
FiberId.None
when creating Promises by @kyri-petrou in #471 - Additional
CompletedRequestMap
constructors and deprecations by @kyri-petrou in #473 - Update README to show new
CompletedRequestMap
constructors by @kyri-petrou in #472 - Update ZIO version and increase SBT memory by @kyri-petrou in #475
- Update README.md by @zio-assistant in #474
Full Changelog: v0.6.1...v0.7.0
v0.6.1
Release Notes
This release brings a new set of constructors for CompletedRequestMap
, which allow create one from iterables. It also includes an important bug fix that caused significant performance degradation of queries composed of parallel and sequential datasource-based queries. It is fully backwards compatible with v0.6.0
New additions
- Implement Some Additional Completed Request Map Constructors by @adamgfraser in #460
- Add
fromZIONow
variant offromZIO
by @kyri-petrou in #465
Performance improvements and fixes
- Fix issue with parallel queries being executed multiple times if zip is used by @kyri-petrou in #464
- Avoid filtering requests when
CompletedRequestsMap
is empty by @kyri-petrou in #466
Other changes
- Update README.md by @zio-assistant in #461
- Add benchmark to compare performance with Fetch by @kyri-petrou in #463
- Check binary compatibility using MiMa & update dependencies by @kyri-petrou in #462
New Contributors
- @kyri-petrou made their first contribution in #463
Full Changelog: v0.6.0...v0.6.1
v0.6.0
This release changes the signature of Request
to be invariant. This increases the type safety of queries but may mean the compiler is stricter in enforcing that in some cases. In connection with this, the signature of CompletedRequestMap#insert
has been updated to not be curried for improved type inference. If you are using higher level constructors to define your data sources this change should not impact you.
What's Changed
- Make Current Cache Public by @adamgfraser in #443
- Update dependency node to v18.18.1 by @renovate in #444
- Update dependency node to v20 by @renovate in #448
- Asynchronous Cache by @adamgfraser in #451
- Prevent Degenerate Data Source Implementations by @adamgfraser in #453
- Update README.md by @zio-assistant in #454
- Optimize ZQuery#foreachBatched by @adamgfraser in #455
- Optimize ZQuery.foreachBatched by @adamgfraser in #457
New Contributors
- @zio-assistant made their first contribution in #454
Full Changelog: v0.5.1...v0.6.0
0.5.1
This release contains dependency updates.