Skip to content

Instantly share code, notes, and snippets.

View Daenyth's full-sized avatar

Alanna Stone Daenyth

View GitHub Profile
@OlegYch
OlegYch / build.sbt
Last active July 18, 2023 14:50
get compile times by file/dir in sbt
val compileTimes = inputKey[Unit]("Get compilation time for each folder")
compileTimes / aggregate := false,
compileTimes := {
import complete.DefaultParsers._
// val ((depth, _), filter) = (NatBasic ~ " " ~ StringBasic).parsed
val (depth, filter) = spaceDelimited("depth filter").parsed match {
case Seq(depth, filter) => (depth.toInt, filter)
case _ => sys.error("expected depth and filter arguments, eg '2 /'")
}
val s = state.value
@bpholt
bpholt / generate-publishing-keypair.sh
Last active May 19, 2023 16:50
generate a GPG key pair for signing artifacts published by sbt, save it to a 1Password vault, and set the necessary secrets for GitHub Actions
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail
IFS=$'\n\t'
RED='\033[1;31m'
NC='\033[0m' # No Color
readonly RED NC
function log_error () {
echo -e "$1" > /dev/stderr
}

Understanding Comparative Benchmarks

I'm going to do something that I don't normally do, which is to say I'm going to talk about comparative benchmarks. In general, I try to confine performance discussion to absolute metrics as much as possible, or comparisons to other well-defined neutral reference points. This is precisely why Cats Effect's readme mentions a comparison to a fixed thread pool, rather doing comparisons with other asynchronous runtimes like Akka or ZIO. Comparisons in general devolve very quickly into emotional marketing.

But, just once, today we're going to talk about the emotional marketing. In particular, we're going to look at Cats Effect 3 and ZIO 2. Now, for context, as of this writing ZIO 2 has released their first milestone; they have not released a final 2.0 version. This implies straight off the bat that we're comparing apples to oranges a bit, since Cats Effect 3 has been out and in production for months. However, there has been a post going around which cites various compar

@Baccata
Baccata / hoconLeftovers.scala
Last active August 28, 2024 08:41
Poor man's solution for getting the "remainder" of a hocon config after its decoding, in order to increase confidence when moving/deleting config values
//> using dep "com.typesafe:config:1.4.3"
//> using dep "com.github.pureconfig::pureconfig:0.17.6"
//> using scala "2.13.14"
import com.typesafe.config._
import pureconfig.generic.semiauto._
import pureconfig.ConfigReader
import pureconfig.ConfigSource
import java.{util => ju}