Bug #16505
closedBug #16382: Improve performance of policy generation writer
Change ZIO runtime ergonomics
Description
An other little PR from the big parent one:
We run all our effects on ZIO
blocking
thread pool, which is a thread pool with unlimited thread number but each time a thread is needed and none available, a new one is created, and unused thread are quickly destroyed. This is not optimal for our use case where almost all of our effects are extremelly short (ie: more writting a file / eval JS than wait for a request to a remote server).
This is the correct way to run effect, see: https://github.com/zio/zio/issues/1275 but it is coslty.
We can make things a bit better while we wait for a smarter runtime by changing the blocking thread pool ergonomics:
- make thread live longer when unused,
- make the default pool size bigger,
- make zio runtime yield less often.